O'Reilly logo

Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps by Mark Sherman, Derek Walter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required