In This Chapter
Understanding sensing technologies
Simulating position changes with the emulator’s location simulator
Simulating position changes with a device compatible code driven approach
Detecting whether your app is executing within the emulator
Modulating position change events with Rx
Geographic location has become one of the principal uses of smartphones, and for good reason. Smartphones are portable, they go with us nearly everywhere, and they offer the kind of processing power required to make displaying and interacting with complex maps possible.
The Windows Phone SDK provides an API that makes working with geographic location straightforward. The geographic location APIs on the phone abstract the location-sensing technologies and unburden the developer from having to know anything about the specific hardware in the device. Your app can specify a desired accuracy, either low or high, and the phone does the rest; it decides what location sensing components to use.
The .NET location API is consistent across platforms and can be used in much the same way in a phone app as it can in a desktop CLR application.
This chapter begins with an overview of the location sensing technologies available on Windows Phone and then dives into the location API. The chapter looks at monitoring location changes and at simulating location changes using both the emulator’s location simulator and a custom class compatible with unit testing and testing on a physical device.
Finally, the chapter delves into the Reactive Extensions (Rx) and looks at sampling events to make rapidly firing position changes manageable.
18.221.19.26