Skip to content

Most visited

Recently visited


Making Your App Location-Aware

Dependencies and prerequisites

  • Google Play services client library (latest version)
  • Android version 2.2 (API level 8) or later

You should also read


Activity Recognition

One of the unique features of mobile applications is location awareness. Mobile users take their devices with them everywhere, and adding location awareness to your app offers users a more contextual experience. The location APIs available in Google Play services facilitate adding location awareness to your app with automated location tracking, geofencing, and activity recognition.

The Google Play services location APIs are preferred over the Android framework location APIs (android.location) as a way of adding location awareness to your app. If you are currently using the Android framework location APIs, you are strongly encouraged to switch to the Google Play services location APIs as soon as possible.

This class shows you how to use the Google Play services location APIs in your app to get the current location, get periodic location updates, and look up addresses. The class includes sample apps and code snippets that you can use as a starting point for adding location awareness to your app.

Note: Since this class is based on the Google Play services client library, make sure you install the latest version before using the sample apps or code snippets. To learn how to set up the client library with the latest version, see Setup in the Google Play services guide.


Getting the Last Known Location
Learn how to retrieve the last known location of an Android device, which is usually equivalent to the user's current location.
Changing Location Settings
Learn how to detect and apply system settings for location features.
Receiving Location Updates
Learn how to request and receive periodic location updates.
Displaying a Location Address
Learn how to convert a location's latitude and longitude into an address (reverse geocoding).
Creating and Monitoring Geofences
Learn how to define one or more geographic areas as locations of interest, called geofences, and detect when the user is close to or inside a geofence.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Sigue a Google Developers en WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)