The second screen of my app is to show the data rows of the Firebase database. I am not sure if I understand the ListPicker and ListView or should I just use a loop to populate the screen? The database has 8 tags, with then rows of data, each row has the tag or key of the posting data/time. See images.
Remind me again, are you inputting data to the app, then sending to Firebase, or is the data in Firebase being populated by external means (e.g. arduino/sensor...)?
Both - some values will be added to the database from an arduino (temp, salinity, pH) will be added hourly or several times a day. The other values will be loaded via the app.
From what you say, I might suggest you do something like this, which is to send the data for a measurement twice. Once to the type records, then to the "latest" tag. The last value sent will be the latest, correct?
In your app:
In Firebase:
Then if you need all the latest values you just call back the "latest" tag. If you need the history for a type, then call that tag back, or you can of course call back the whole lot.
I am using this code that does similar to what you have.
What I am trying to figure out is how to populate the above screen. At the top I want to select which tag tree to present. and then read backwards the data.
Look again at my structure, and the top node which is aquarium (this is set as projectBucket)
To populate your display, you need to call back the tag for the selected value (create a spinner or use a popup menu extension for this).
Then you would send your get value:
e.g. as in my example
getValue: salinity
which will return all the values in the tag salinity. You would then need to process the returned json (make human readable dates from timestamps/ get the value for each) for displaying in a list.
I do not see a getValue in your example?
This is my data format.
I just added a spinner to the top of the screen. For now I am using an entered list of elements.
I setup a spinner from your tutorial.
Now I am trying to populate the rows of data. I thought I would at least get the first row with data from the getValue.
why would I add value to label vs text box?
how can I look at the json?
in C or cobol I would debug with lots of print statements to visualize what is happening
Is Label1 the selection of which type?
The Label2 is the display area for the bottom of the screen? If the database has more data then will fit on screen?