,

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

Image

FIGURE 17.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. For this, a managed code layer exists, which provides a hardware agnostic API. Recall from Chapter 2, “Fundamental Concepts in Windows Phone Development,” that P/Invoke is not allowed at all on the phone. All interoperation with location components on the phone must therefore be done via the managed layer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.251.142