Location Data

Location is just a set of numbers: latitude and longitude. You can always ask the Location Sensor for its most recent reading of those numbers using the getter blocks because they do appear as component properties. They’re also accessible in the LocationChanged event as parameters. Both methods look at the same data and work exactly the same (see Figure 10.4).

Image

Figure 10.4 Two versions of the LocationChanged event: One gets the location data from the event parameters, and the other gets the data from the component properties. They work exactly the same. Only one can exist at a time in a project, however (which is why the red error ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.