I have a real-time database of Laserscan data in Firebase
I want to display the ranges only.
the ranges are indexed from 0 to 179 I can't capture the entire screen.
I'm new to MIT app inventor and never worked with JSON
your help would be much appreciated
tag ranges should be returning a list/JSON array (possibly stringified), because the data is set as a firebase array.
Will take a look later...
yes, when I run the app I get the error "java.lang.String cannot be cast to com.google.appinventor.components.runtime.util.YailDictionary"
This is working for me:
and to set the values to a lisstview:
Bear in mind that the AI2 list index starts at 1, so you will have to subtract 1 to get the firebase index.
Also, read this:
Thank you but it didn't work, it returns an empty list.
I tried to read the documentation I think my array is different from your example.
the indexes and values are connected through one line as opposed to yours I think mine is subArray?
Try tag 'Scan/ranges'.
If you are reusing a single Firebase GotValue event for different tag patterns, you will need to add an if/then/elseif tree for the different incoming tags (Scan, Scan/header, Scan/ranges)
You changed your firebase structure after I posted my approach...
ranges was a top level node, now it is a sub-node of Scan. You need to account for this as indicated by ABG.