O'Reilly logo

Learning Android Google Maps by Raj Amal W.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with the Android Location API

The Android framework has an inbuilt android.location package, which helps us retrieve the user's current location.

It can be implemented by using the LocationListener interface. It provides four methods. They are:

  • onLocationChanged()
  • onStatusChanged()
  • onProviderEnabled()
  • onProviderDisabled()

The onLocationChanged() method is called when the location is changed (when the user moves). The onStatusChanged() method is executed when the status of the provider is changed (the provider may be unavailable initially and available after some time). The onProviderEnabled() and onProviderDisabled() methods are called when the location provider is enabled and disabled.

Then, we should use the LocationManager class to get access ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required