Book Image

Xamarin Mobile Application Development for Android, Second Edition

Book Image

Xamarin Mobile Application Development for Android, Second Edition

Overview of this book

Table of Contents (18 chapters)
Xamarin Mobile Application Development for Android Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with location services


Integrating the location service in the Android platform is more complicated than it looks.

You need to consider different location providers, location accuracy, user movements, and most importantly the nominal device battery power consumption. While working with location services on the Android platform, you will primarily work with an instance of LocationManager. The LocationManager class provides you with the ability to obtain periodic updates of the device geo location or fires an event when the device enters the proximity of a given geographical location.

Android devices generally provide two different means of determining a location: GPS and Network. When requesting location change notifications, you may specify the provider you wish to receive updates from. The Android platform defines a set of string constants for the following providers:

Provider name

Description

GPS_PROVIDER (GPS)

This provider determines a location using satellites. Depending on...