It's the 15th anniversary of Google Maps Platform!   Check out the latest news and announcements.

Get Started

To configure your app to use the Places SDK for Android, follow these steps. They are required for all apps using the Places SDK for Android.

Step 1. Install the SDK

The Places SDK for Android library is available through Google's Maven repository. To add the SDK to your app, do the following:

  1. In the buildscript.repositories section of your top-level build.gradle file, make sure Google's Maven repo is listed:

    buildscript {
        repositories {
            google()
            // ...
        }
    }
  2. In the dependencies section of your app-level build.gradle file, add a dependency to the Places SDK for Android:

    dependencies {
        implementation 'com.google.android.libraries.places:places:2.3.0'
    }
    

Step 2: Get an API key

  1. Enable billing on your project.
  2. Enable the Places API for your project.
  3. Follow the Get an API Key guide to get, add, and restrict an API key.

Step 3. Initialize the Places API client

Initialize the Places SDK for Android within an activity or fragment as shown in the following example (note that you pass the API key when calling Places.initialize()):

Java

// Initialize the SDK
Places.initialize(getApplicationContext(), apiKey);

// Create a new PlacesClient instance
PlacesClient placesClient = Places.createClient(this);

Kotlin

// Initialize the SDK
Places.initialize(applicationContext, apiKey)

// Create a new PlacesClient instance
val placesClient = Places.createClient(this)

You are now ready to begin using the Places SDK for Android!