I'm having a problem with sorting my list in my app. I've made a demo where Users can register a patient in the app and be shown there and the rest in a list.
My plan is that whenever a user registers, that goes into a list and tagged into a sorted number. First register goes into 1, the second goes to 2 and etc. Those sorted will be then sorted accordingly into Firebase then get back for viewing. This viewing will be accordance to what number the patient is given (Patient 1 goes to 1 and so on.) If a user wishes to delete a patient, for example Patient 2, then Patient 1 will be moved to 2 and becomes the new Patient 2. That would mean if a user registers into a new patient, it goes back to one and becomes patient 1.
I've gotten only getting the data, but no idea how to update, store, delete and sort it
Ah, I think the cause for that is that I changed the Firebase Token to get another db from another app I made, my bad.
Also regarding the algorithm, I have made that so as I was planning to have these patients have pictures beside them, and I have no clue how to save images into the Firebase.
My problem currently is the delete button doesnt work completely. It deletes the element on the list, but not on the actual Firebase Database. Does anyone know what I'm doing wrong here?
Your problem might be the global variable OrderTag.
I see 2 possibilities for what your intentions are for that variable:
The high water mark for all patient numbers, for purposes of assigning new patients unique numbers, or
the last chosen patient number, for purposes of setting up a proper deletion of a patient from Firebase.
You might be missing a global variable, needed to distinguish between the two uses.
Consider adding the patient number to the contents of your ListView Elements, to simplify the update and deletion processes by using the Selection instead of the SelectionIndex.
Your Elements are close to YAML in their formats,
Going full YAML would make extraction from an Element easier (split Selection at \n to get tag:value list, split each item at : to get tags and values.)
I've downloaded the FirebaseStorage Extension so I can store images and put it in both the List and Firebase. Now I'm wondering how do I store the image and or the filepath in the list and into the Firebase.
You should also be considering patient confidentiality. At present I am guessing you have read and write settings as true in your realtime database and storage. This may not be advisable in production, which will present you with some issues when using the extensions....
also, since you are deleting the patient please do not use patient count while saving the data in firebase, you will meet collapse of algorithum then..
To avoid the confusion pls use timestamp in running format or random integer
I tried using it but it comes out as an error like so
I'm trying to upload an image into the app for the patients profile picture, and then after clicking the register patient button, save both on the list and into the Firebase
I have never seen the path/directory Phone Storage before. if it does exist the fact that there is a space in the directory name is most probably causing the problem.
Android OS is essentially a linux framework, therefore spaces in directory and filenames should be avoided.
Phone storage means that the storage I'm taking is not in the SD card but unto the phone itself since the phone has its own storage, like in case you dont have an SD card on your device, so you use the Phone's storage itself to store stuff. This is getting a bit confusing for me to be honest. Do you have an example I can draw upon? preferably where the user picks an image wherever? SD or Phone Storage and then stores it in Firebase and be able to get it back? If not... maybe I'll just stick to TinyDB for the Image only instead