Search code examples
androidscreenapp-inventor

App Inventor - Carrying data to multiple screens


I have created an app for a project, it is just a small quiz app, I want the score to update each time the user gets a question correct and not change when they get the question incorrect, each question is on a new screen, at the moment the score updates but when the new sceen appears with the next question the score is not updated, how can I update the score in the new screen and then keep it the same if the user answers incorrectly.

Much appreciated.

The top part of the image is screen 1 and the bottom part is screen 2. As you can see i'm having trouble with getting the score to be updated in screen 2 if the person answers correctly.

https://i.sstatic.net/VkX8o.jpg


Solution

    1. see the TinyDB tutorial here https://sites.google.com/site/stevozip/home/AI2/tinydb
    2. switch screens correctly, see also https://puravidaapps.com/manager.php
    3. use only 1 screen and some logic instead of n screens, see also http://ai2.appinventor.mit.edu/reference/other/manyscreens.html and my quiz example here https://puravidaapps.com/quiz.php

    A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks. There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
    How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

    Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor