New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see New map style for Google Maps Platform.
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 list
Key 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.
In Android Studio, select File > New > Import Project.
Go to the location where you saved the repository and select the project directory for
Kotlin or Java:
Kotlin: PATH-REPO/android-samples/ApiDemos/kotlin
Java: PATH-REPO/android-samples/ApiDemos/java
Select Open. Android Studio builds your project, using the Gradle build
tool.
Create a blank secrets.properties file in the same directory as your project's local.properties file. For more information, 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
Run the app.
Sample app for maps on Wear OS
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.
[[["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-02-24 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"]]