O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

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

Get Coordinates from the GPS Sensor

The network sensor uses cell towers and Wi-Fi access points to determine the device’s location. It is not as accurate as the GPS sensor, but it is faster. Additionally, it is available on all devices, whereas a GPS sensor is not. For this reason, it might make sense to begin the discussion of getting location from sensors with the network sensor. However, the network sensor cannot be tested on the emulator, whereas the GPS sensor can. Also, the code required to use both sensors is almost identical. For these reasons, the GPS sensor is discussed first.

To use the GPS sensor, you replace the Geocoding code in the Get Location button with GPS listener code. You also add a method to turn off the location sensing ...

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