Adding location services to POIApp

In POIApp, we have the following two different scenarios for requesting location updates:

  • In the POI list, we need to calculate the distance of each of the listed POIs. In this scenario, we want to request location change notifications on an ongoing basis and use the most current location to calculate the distance.
  • In POIDetailFragment, we would like to request the current location when adding a new POI. In this scenario, we would want to request a single location change notification.

Adding location services to the POI list

Now that we have some idea of how to add location services to an app, let's add location services to POIListFragment as follows:

  1. Declare a private instance of LocationManager and obtain a reference ...

Get Xamarin Mobile Application Development for Android - Second Edition 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.