Book Image

Windows Phone 7.5: Building Location-aware Applications

Book Image

Windows Phone 7.5: Building Location-aware Applications

Overview of this book

Windows Phone 7.5 has met with some great initial reviews from all mobile critics. It is poised to be the '3rd' eco-system for mobile, joining Apple's iOS and Google's Android platform. With Microsoft and Nokia working on multiple devices based on Windows Phone, the platform is a no-brainer enterprise success. Microsoft Office, Email, Skype and a fresh new mobile operating system has been a great champion of a cause for both Microsoft and Nokia. "Windows Phone 7.5: Building Location-aware Applications" will teach you to divein to the new Windows Phone Experience. No more 600 page bibles - just the right mix of text and lots of code to get you started!"Windows Phone 7.5: Building Location-aware Applications" covers location based services and maps, and focuses on methods of location detection and maps. Powered with this information, two real-world applications are covered. In short, this is a concise book on building location aware apps for Windows Phone.
Table of Contents (11 chapters)
Windows Phone 7.5: Building Location-aware Applications
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

How Microsoft uses LBS in Windows Phone 7.5


Microsoft's Windows Phone 7.5 (Mango) is a fresh new approach to mobile operating systems and user interfaces. In fact Microsoft has got good reviews from every quarter of the mobile phone world. What's different with Windows Phone is the emphasis on an integrated user experience rather than apps. The Metro user interface is clean, engaging, exciting, and different. Keeping the interface relevant and inclusive for the users, Microsoft has kept location as a compulsory hardware requirement for all Windows Phone handset manufacturers. This also signifies the important role of location in current and future Windows Phones. See Hardware Specifications for Windows Phone at:

http://msdn.microsoft.com/en-us/library/ff637514(v=vs.92).aspx)

Let us now understand how Microsoft uses LBS in Windows Phone 7.5. As we learnt earlier, all WP7.5 phones have A-GPS and Wi-Fi capabilities built in the phone. This coupled with the Microsoft Location Service completes the location hardware and software required to build our location-aware apps!

Microsoft Location Service

In order to use the location APIs in your WP7.5 application, you need to include the System.Device.Location assembly in your application. Before you can use location in your app, make sure your device has location enabled; if not, you can enable it from the SETTINGS page on your WP7.5 Phone, as shown in the following screenshots from our Nokia Lumia 800:

The GeoCoordinateWatcher class is the class which exposes the Windows Phone Location Service. It contains methods for both:

  • Getting location information on demand

  • Sending location information on position change or status change

Lastly, as with all mobile phone platforms, Microsoft has bundled an excellent location sensor simulator with the Windows Phone 7.1 SDK, which can be used to simulate location via live real-time values as well as saved values as shown in the following screenshot: