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

Saving Location Data

A location is just a small set of numbers, so we can save it like any other number. For example, we can store latitude and longitude in a pair of global variables. We can add them to a list. We can store them to the phone’s local persistent storage with TinyDB. We can put them online with TinyWebDB. We can email them or text them, or do anything else with them, because they’re just numbers.

Keep in mind that global variables, including lists stored in them, keep data only as long as the app is running. When you go back to the home screen or switch to a different application, the operating system might close your app and then data in variables would disappear. To save your data so that it reliably comes back, you have to put ...

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