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

Location Sensors

Android devices typically have two location sensors. One sensor (network sensor) is based on the cell towers and/or the Wi-Fi access points your device is connected to. This sensor provides the approximate location of the device. The other sensor is based on a built-in Global Positioning System (GPS) receiver. This sensor can provide position information accurate to within a few meters, depending on conditions. However, the GPS sensor is much slower in acquiring its position information than the network sensor. Additionally, not all devices have a GPS sensor.

Location information is accessed within an app through the use of the LocationManager object. A LocationManager is not directly instantiated. It exists as an Android system ...

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