I'm relatively new to the imt app inventor and i have to make an app as a school project. My app includes a game with a stopwatch. The player with the shortest time sets the new high-score. I used a clouddb to store the data but it doesnt seem to send the data to other devices. Is it possible to share the data with other users? Did I use the wrong storage?
I also googled and watched a lot of yt videos but i couldnt find one that answered my question.
Your app has multiple issues, the main issue is you do not have a CloudDB.DataChanged block in your Project.
Do the tutorial; see how the CloudDB sharing works, then apply the technique to your game.
You might also look at the documentation for CloudDB to get additional explanation about how the Blocks work.
When you have done that, create a simple CloudDB app that shares one piece of information. Get that to work. Remember, to test your app you basically need at least two Android devices with your compiled aia installed on each (or you can install on one and use a second device using Companion in live development). How are you testing to see what works (and what does not work). With a little bit of patience, you will get your app to work.
Also, here is a game using CloudDB that can be played on two devices.
You can try it out also to see how the database works.
Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
Hello
I'm still working on my school project and there are still a lot of errors. I also want to apologize in advance for the names of the elements and that I'm asking again. The cloud does save data but it doesnt show the right one on the screen. The highscore is selected with a stopwatch. The person with the shortest time wins.
Both me and my teacher already tried to find my mistake but we couldnt fix it for several hours.
I see from your blocks that you store score information from global variables into TinyDB in the initialization section of screen gratulation.
The initialization event runs at screen startup, when global variables have not had a chance to be updated in other events, so you will always be storing zeroes or blanks.
AI2 global variables do not persist across screens.
To pursue this further, we would also have to see how scores are generated and saved in the other screens.
By the way, for a small app like this, it is easier to stick to one screen and use stacked vertical arrangements, only one visible at a time.