Search
Mobile

Windows Phone 8 : Building Location Aware Apps - Location Sensing Technologies

Published 3 min readBy Programming4us Editorial Team

Location Sensing Technologies

Windows Phone uses the following strategies to determine its geographic location:

- A-GPS

- Wi-Fi triangulation

- Cell tower triangulation

Each strategy has advantages and disadvantages, depending on environmental factors and power efficiency requirements (see Figure 1). The following sections discuss the pros and cons of each technology.

FIGURE 1 Sensor technologies available to Windows Phone.

A-GPS

Assisted Global Positioning System (A-GPS) is a satellite-based positioning system, which is generally the most accurate of the geo location methods available on the phone. The accuracy afforded by A-GPS, however, comes with a power penalty. It uses significantly more power than the other two sensing technologies. Because of this, it should be used only when an application needs a high level of accuracy.

GPS uses radio signals from satellites and does not perform as well in dense urban areas. In poor signal conditions, signals may suffer multipath errors; signals bounce off buildings or are weakened by passing through tree cover.

A-GPS is an extension to GPS. It improves GPS’s startup performance by using an assistance server to supply satellite orbital information to the device over the network. This is faster than acquiring the information from the satellite itself, which can also prove difficult in low signal conditions.

Cell Tower Triangulation

Cell tower location uses triangulation against multiple cell towers to pinpoint the phone’s location based on the ping time from each tower. The distance from a single cell tower can be roughly determined by the time it takes for a phone to respond to a ping. The location of the cell towers combined with their ping times allows the phone’s location to be pinpointed (see Figure 2).

FIGURE 2 A phone’s location can be pinpointed using cell tower triangulation.

Accuracy increases as more towers are included in the calculation.

Although cell tower triangulation uses less power than A-GPS, it is less accurate. Cell tower triangulation works best where there are more cell towers. Thus, areas such as city fringes or countryside may not provide an adequate level of accuracy. Unlike A-GPS, however, cell tower triangulation works indoors.

Wi-Fi Triangulation

Wi-Fi triangulation provides a middle ground between A-GPS and cell tower triangulation. Wi-Fi triangulation uses less power than GPS and can provide better accuracy than cell tower triangulation in some environments.

Wi-Fi location relies on a global location database of Wi-Fi networks and the ability of a phone device to detect Wi-Fi networks within its vicinity.

Wi-Fi triangulation works by detecting networks that are in range, measuring the signal strength of each network, and then triangulating the result using the Wi-Fi network location database.


Note

The Wi-Fi network location database is provided by the company Navizon; currently, no public API exists for accessing the data directly.

Geographic Location Architecture

The Windows Phone location architecture consists of three layers: a hardware layer, a native code layer, and a managed layer (see Figure 3).

FIGURE 3 Location architecture layers.

The hardware layer comprises the location related hardware components in the phone device, which includes a GPS receiver, a Wi-Fi interface, and a cellular radio. Each serves as a provider of location information with varying degrees of accuracy and power consumption.

The second layer, a native code layer, communicates directly with the hardware devices to determine the location of the device. The choice of hardware component, or combination of components, depends on the accuracy level requested by the app and the availability of data; there may not be any Wi-Fi networks in the vicinity, for example.

The native code layer also uses a Microsoft web service to provide location related information from a database.

Code cannot be written to directly interact with the native layer, nor the hardware layer.