Stay organized with collections Save and categorize content based on your preferences.
The Maps SDK for Android repository on GitHub includes samples illustrating the use of the Maps SDK for Android in your Android app.
The repository contains the ApiDemos app, a sample app that lets you build and run the samples from a single Android app. 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 Basic Map.
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.
Maps SDK for Android sample app listKey sample activities contained in the Maps SDK for Android ApiDemos app are listed below and reproduced at the linked pages for quick reference. See the Kotlin or Java folder for the full list of available samples.
Clone and run the samplesGit is required to run this sample locally. The following command clones the sample application repository.
git clone git@github.com:googlemaps-samples/android-samples.git
Import the sample project into Android Studio:
Go to the location where you saved the repository and select the project directory for Kotlin or Java:
PATH-REPO/android-samples/ApiDemos/kotlin
PATH-REPO/android-samples/ApiDemos/java
secrets.properties
file in the same directory as your project's local.properties
file. For more information about this file, see Add your API key to the project.Add the following string to secrets.properties
, replacing YOUR_API_KEY with the value of your API key:
MAPS_API_KEY=YOUR_API_KEY
A sample app for Maps SDK for Android on Wear OS is available on GitHub, which you can use as a starting point when building a wearable app. The sample shows you how to set up a basic Google Map on Wear OS.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["This page provides access to the Maps SDK for Android sample code and apps, including a comprehensive ApiDemos app containing various map feature examples."],["Developers can clone the sample repository from GitHub, import it into Android Studio, add their API key, and run the app to explore different map functionalities."],["The ApiDemos app showcases key features such as basic maps, markers, events, polylines, polygons, and My Location, with code samples readily available for use."],["Troubleshooting guidance is provided if the map doesn't display, directing users to verify their API key configuration."],["A separate sample app specifically for Wear OS is available on GitHub, demonstrating how to integrate Google Maps into wearable applications."]]],["The Maps SDK for Android samples are available on GitHub. To use them, clone the repository, import the ApiDemos project into Android Studio (either Kotlin or Java), and add your API key to the `secrets.properties` file. Run the app to view a list of samples like Basic Map, Markers, and Polylines. A separate Wear OS sample is also available on GitHub, showing basic map setup for wearable apps. Ensure your API key is correctly added to the app manifest if you encounter map display issues.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4