Time for action – trying out native location tracking
Later we will add in a feature to allow the app user to add to a set of favorite locations. For the moment, we'll just try out the basic functions. Location doesn't work in the simulators; you'll have to try this on a real device.
Use the test-rig stack from above, and add a Get Location button and a
location
field. Make sure thelocation
field is as wide as the card window; it will be showing three long numbers.Set the script of the button to the following:
on mouseUp mobileStartTrackingSensor "location", true put mobileSensorReading("location", false) into field "location" mobileStopTrackingSensor "location" end mouseUp
The
true
in the second line is the one that defines a "loose" value, and we're saying that we don't need the precision of GPS. Thefalse
in the third line is saying that we don't need detailed information to be returned.Go to Standalone Application Settings, choose your target device: iOS or Android.
For iOS, set...