O'Reilly logo

LiveCode Mobile Development Beginner's Guide by Colin Holgate

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

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.

  1. Use the test-rig stack from above, and add a Get Location button and a location field. Make sure the location field is as wide as the card window; it will be showing three long numbers.
  2. 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
  3. The true in the second line is the one that defines a "loose" value, and ...

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