Select platform: [Android](https://developers.google.com/maps/documentation/places/android-sdk/examples.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/places/ios-sdk/examples.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/examples.md.txt "View this page for the JavaScript platform docs.")

The Places SDK for Android samples repository on
[GitHub](https://github.com/googlemaps-samples/android-places-demos)
includes sample apps that demonstrate the use of the Places SDK for Android.
Import and build the app, add your API key, view the demo, and use the sample code supplied as a
starting point for your app.

When you run the sample app, it displays a list of available samples that you can
run on your own device. Select one of the options. For example, click
**Place Autocomplete**.

> [!NOTE]
> **Troubleshooting:** If the sample app runs successfully but you don't see a map, check that you've added your API key to the app's manifest file, as described in [Using API Keys](https://developers.google.com/maps/documentation/places/android-sdk/get-api-key.md.txt).

## Clone and run the samples

Git is required to run this sample locally. The following command clones the sample
application repository.

```
git clone git@github.com:googlemaps-samples/android-places-demos.git
```

Import the sample project into Android Studio:

1. In Android Studio, select **File \> New \> Import Project**.
2. Go to the location where you saved the repository and select the project directory for
   Kotlin or Java:

   - **Kotlin** : `PATH-REPO/android-places-demos/demo-kotlin`
   - **Java** : `PATH-REPO/android-places-demos/demo-java`
3. Select **Open**. Android Studio builds your project, using the Gradle build tool.
4. In your top-level project directory, create a `secrets.properties` file.
5. [Get an API key](https://developers.google.com/maps/documentation/places/android-sdk/get-api-key.md.txt) from your project with the [Places API and/or Places API (New) enabled](https://developers.google.com/maps/documentation/places/android-sdk/cloud-setup#enabling-apis).
6. In the `secrets.properties` file, add the following strings, replacing **YOUR_API_KEY** with the value of
   your API key:

   ```
       PLACES_API_KEY=YOUR_API_KEY
       MAPS_API_KEY=YOUR_API_KEY
     
   ```
7. Run the app.