Chapter 7

Leveraging Location and Maps

WHAT’S IN THIS CHAPTER?

  • Locating frameworks on smartphones
  • Getting the current location
  • Using GPS on the WP7 Emulator
  • Using the Bing Maps control
  • Showing locations on Bing Maps

Location-based applications are becoming one of the most popular categories of mobile application across major mobile OSs. GPS enables applications to obtain accurate geographic location information, which is essentially a built-in component on smartphones, together with the required cellular data and sometimes a Wi-Fi location database. Each mobile OS has to provide an easy-to-use location framework that allows developers to programmatically use location data, maps, and map overlays for a wide range of scenarios. Windows Phone 7 (WP7) is no exception.

This chapter starts with an overview of the location framework on three smartphone platforms: WP7, iOS, and Android. In addition, you’ll see examples that show you how to get the location information on WP7 and demonstrate how to use the Bing Maps Control. In particular, you’ll learn how to acquire current geographical location information using the System.Device.Location namespace and how to test your location-aware applications on WP7 emulators. In addition, you’ll find out how to use Bing Maps web services to convert addresses (such as a street name) to geographic coordinates. You’ll also discover how to use the Microsoft.Phone.Controls.Maps namespace to draw and navigate maps on WP7 devices. An example is also ...

Get Windows® Phone 7 Programming for Android™ and iOS Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.