Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps
by Derek Walter, Mark Sherman
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 ...
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