Location information is becoming increasingly important in the world of mobile development. The capability to easily retrieve and provide location data to apps is becoming a major feature of today’s mobile platforms.
Android provides this functionality with its location service.
Android’s location service provides access to facilities that can be used to determine a device’s current location.
METHODS USED TO DETERMINE LOCATION
The Global Positioning System (GPS) uses a system of satellites orbiting the planet to help a receiver (an Android handset in this case) determine its current location. The term GPS refers to the entire GPS system, which consists of satellites, receivers, and the control stations that monitor and adjust it.
- Although GPS can provide the most accurate location data, it does have limitations that may be difficult to work around. First is the fact that a GPS receiver needs a clear path to a GPS satellite. This means that GPS receivers are unlikely to work indoors, and may even have problems outside in areas where the sky is not visible (such as dense forests). Additionally because multiple GPS satellites are needed to produce location information, it may take a substantial amount of time to acquire a location. For these reasons, other sources of location information are sometimes needed.
- Objects that obstruct a GPS signal may cause the signal to be reflected before it reaches the GPS receiver. GPS signals that are reflected off of objects have a different path from the GPS satellite to the GPS receiver and cause the distance calculation to be erroneous. These types of errors are called multipath errors and can cause the location to appear to jump from one place to another. This is often seen in urban areas where GPS signals frequently bounce off of tall buildings.
Network location provider can provide location information using cell
towers or based on wireless network information.
Using Wireless Network Access Points
- Although it does require that the Wi-Fi radio is active, the Wi-Fi radio often consumes less battery power than the GPS hardware.
- Wi-Fi-based location detection works by having a device track what Wi-Fi access points it can detect and the current signal strength of those access points. The device then makes a query to the Google location service (which is different from the Android location service) which provides location data based on the Wi-Fi information.
- The Wi-Fi information collected by the device includes the mandatory access control (MAC) addresses of the Wi-Fi access points that are in range and the strength of the signal being received from those access points.
- To provide location information based on visible Wi-Fi access
points, the Google location service must obtain information
about Wi-Fi access points and their locations. This information
is collected by Android devices when a user enables use
of Google’s location service in the Location Settings screen.Eg. Refer to the image below:
- Pressing Agree on this screen allows the device to record
Wi-Fi information as well as current location information
(possibly provided by GPS) and transmit this information to
Google. This essentially allows Google use each and every
Android device as a way to update the Wi-Fi location information
and constantly maintain up-to-date data.
- First, to determine the location, Wi-Fi networks must be in range. Additionally, the networks must have a publicly broadcasted service set identifier (SSID) that has been configured to be detected by Android.
- Access points that have an SSID that ends in _nomap will not have their information sent to the Google location service. Additionally, changes to the location of Wi-Fi access points can cause inaccuracies in the location data that is produced. For example, many people now have wireless networks in their homes for daily use. Assuming an Android device has been configured to use the Google location service, Android would have sent the access point MAC address and location to the Google location service. If the user were to change the location of that access point (take it to a vacation home, for example), the location service might determine the device to be in the wrong location when the Wi-Fi location source is used.
Using Cell IDs
- To function properly, a cellular device must be in contact with a cell tower. As a device moves, it may connect to a different cell tower as the signal strength of an approaching cell tower becomes stronger. Knowing the unique ID of the tower that a device is currently connected to and possibly the towers that a device was previously connected to, can provide insight to where the device is
located assuming the location of a given cell tower is known.
- When a device needs to find its current location, it sends the ID of the cell tower it is currently connected to, as well as historic information about past cell towers it has used, to the Google location service. With this information, the Google location service can provide information about the device’s current location based on the data it has about the cell tower network. If the IDs of multiplecell towers are sent to the Google location service, it can use triangulation to provide increased location accuracy. The Google location service cannot do this if the device submits only a single cell tower ID.
- The limitations for using cell tower IDs are similar to the limitations that exist when using Wi-Fi networks to determine location. However, because the location of cell towers is less likely to change than the location of wireless access points, some of the complications that may exist when using Wi-Fi access points are removed.
- Like Wi-Fi access point data, the Google location service must have data on the cell tower IDs that are sent by a device in order to provide location data.
So much so for part 1 of this discussion. We’ll explore more technical stuff in part 2 mainly, Android Location API components and usage of the Location API to determine a device’s current location.