Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps
by Derek Walter, Mark Sherman
Sharing Data Between Screens
Screens are like individual apps that you can switch between. They don’t share variables or blocks, so getting information from one screen to another takes a little bit of setup.
One of the more convenient ways to get data across screens is to use TinyDB. Anything you store in TinyDB is available in all the screens. TinyDB stores its data on the phone, not in the app itself, so the data in it persists even when the app is closed or screens are switched.
For example, you might have a page where the user can specify settings. Whenever a setting is changed, it gets stored immediately to TinyDB. This way, when the app is closed, those settings are remembered and honored. Now, because it uses TinyDB, those settings can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access