Stay organized with collections Save and categorize content based on your preferences.
Before you beginBefore you start using the Maps SDK for Android, you need a project with a billing account and the Maps SDK for Android enabled. To learn more, see Set up in Cloud console.
Creating API keysThe API key is a unique identifier that authenticates requests associated with your project for usage and billing purposes. You must have at least one API key associated with your project.
To create an API key:
ConsoleGo to the Google Maps Platform > Credentials page.
gcloud services api-keys create \ --project "PROJECT" \ --display-name "DISPLAY_NAME"
Read more about the Google Cloud SDK , Cloud SDK installation , and the following commands:
Note: You can use the same API key for your Maps SDK for Android and Places SDK for Android apps. Restricting API keysGoogle strongly recommends that you restrict your API keys by limiting their usage to those only APIs needed for your application. Restricting API keys adds security to your application by protecting it from unwarranted requests. You are financially responsible for charges caused by abuse of unrestricted API keys. For more information, see API security best practices.
When restricting an API key in the Cloud console, Application restrictions override any APIs enabled under API restrictions. Follow best practices by creating a separate API key for each app, and for each platform on which that app is available.When you restrict your API key, you must provide the SHA-1 certificate fingerprint of the signing key that was used to sign the application. There are two certificate types:
For more information about Android application signing and certificates, see the Sign your app guide.
For instructions on how to find your signing certificate fingerprint, see the references below:
To restrict an API key:
ConsoleGo to the Google Maps Platform > Credentials page.
com.example.android.mapexample
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75
List existing keys.
gcloud services api-keys list --project="PROJECT"
Clear existing restrictions on existing key.
gcloud services api-keys update "projects/PROJECT/keys/KEY_ID" \ --clear-restrictions
Set new restrictions on existing key.
gcloud services api-keys update projects/PROJECT/locations/global/keys/KEY_ID \ --api-target=service=maps-android-backend.googleapis.com --allowed-application=sha1_fingerprint=SHA1_FINGERPRINT,package_name=ANDROID_PACKAGE_NAME
Read more about the Google Cloud SDK , Cloud SDK installation , and the following commands:
What's nextNow that you have an API key, create and configure a project as described in Set Up an Android Studio Project.
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-07-18 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-07-18 UTC."],[[["An API key is required to use the Maps SDK for Android and can be created through the Google Cloud Console or the Cloud SDK."],["Before using the API key in production, it's crucial to restrict it for security by specifying allowed Android apps and APIs."],["Restricting the API key involves providing the package name and SHA-1 certificate fingerprint of your Android application."],["The same API key can be used for both the Maps SDK for Android and Places SDK for Android applications."],["After obtaining and restricting the API key, proceed to set up and configure your Android Studio project."]]],["To use the Maps SDK, you need an API key, created via the Google Cloud Console or Cloud SDK. The Console method involves navigating to the Credentials page and creating an API key. The Cloud SDK uses the `gcloud services api-keys create` command. Restrict API keys for security, selecting \"Android apps\" and adding the package name and SHA-1 certificate fingerprint. Use separate keys for each app and platform. You can also do this using Cloud SDK, with `gcloud services api-keys update`.\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