Hi I have made a game with app inventor called mathematics .
If someone makes high score, that score stores in firebase all ok , tag=players name and value his name& score … as image below
But I want to retrieve all values from database in a listview to show all players with highscore .How can I manage that?
Set ProjectBucket at correct level (Mathematicks)
Get TagList (sakis, navoc, etc)
Iterate over the taglist to select name and score for each entry
Display
The “better” method is to create another “bucket” when data is uploaded containing just the names and scores. Then you can call all that back using firebase rules to do the ordering and some parameters using the web component.
Thank you for your answer.
I did store them in different way .
But how can I retrieve all tags and values in a list to show all highscored players
3rd image no value retrieve
As I mentioned you will need a subset of data saved to firebase for this to work.
Under your main project bucket you need a child called “scores”, then you save to this the player name and their score (at the same time as you save then to the mathematiks child) so that you end up with:
scores
2 test: 400
3 test: 200
4 test: 500
You then use a GET request in AI2 web component to call back the data in scores
As I said above, you need to pull the returned data into a list, swap the name and the number around, so instead of andreas,15 you have 15,andreas, then apply leading zeros to each number so that you can sort: 0015,andreas; 0018,pitis etc.
For the third time…
You need to set the numbers with leading zeros
Do this when you swap the name and number around.
For your current numbers you need 3 digits, if scores will go into the hundreds then you need 4 digits
but I still have a problem when it comes to retrieving the list
i use the same way the key liste but i don’t understand why list are this way [John,Julia]
when i check with is a list? thing i get false
I think something triggers from the app and delete all the data from firebase.
One time happened when updated the app , and other time I did not understand .
Is there any rule to auto delete firebase values ?
I create new firebase with new email user but it happened again