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 ...