How do you know where you are?

The LocationSensor communicates with GPS satellites and other mechanisms to determine the location of your phone/tablet.

Example 2. How do you know how far you are from a given point?

example 1

App Inventor doesn’t provide a “distance” block for computing the distance between two GPS coordinates. But there are known mathematical formulas for approximating such a distance between two points. The solution is to create your own block-- a procedure-- and plug in one of the known formulas. The procedure “distance” above uses a formula from http://geokoder.com/distances. Once you have a distance procedure, you can call it as in the bottom row of the LocationChanged event handler. This sample computes the distance from your current location and the University of San Francisco campus.