Google Maps Android API Keys


A Google Maps Android API key is required to use the Google Maps API. Android devices send API requests directly to Google. Google verifies that each request comes from an Android app that matches a package name and SHA-1 signing-fingerprint name that you provide. If the application’s API usage exceeds the usage limits, the developers must load the API using an API key in order to purchase additional quota. For example, and In order to obtain a Google Maps Android API key, the following three steps are taken:
  1. Finding an SHA-1 fingerprint,
  2. Creating a Google API project, and
  3. Obtaining a Google API key.

Finding an SHA-1 Fingerprint
To obtain a Google Maps Android API key, first, we have to calculate the SHA-1 fingerprint of the certificate that we will use to sign the final application. This fingerprint will have to be provided to the Google Maps API service so that it can associate the key with your application. The SHA-1 fingerprint is a unique text string generated from the commonly-used SHA-1 hashing algorithm. Because the fingerprint is itself unique, Google Maps uses it as a way to identify your application. Java’s “Key and Certificate Management” tool named
keytool is used for the fingerprint generation as follows:
  1. Run the JAR signing and verification tool jarsigner.exe
  2. For example, go to the following folder and double click the icon of jarsigner.exe:
       C:\"Program Files (x86)"\Java\jdk1.7.0_45\bin\
  3. Locate debug.keystore
  4. For example, it is in the directory:
       C:\Users\wenchen\.android\
  5. Run keytool
  6. For example, open a Windows command-prompt by selecting the following Windows options:
       Start ⇒ All Programs ⇒ Accessories ⇒ Command Prompt
    go to the following directory:
       C:\"Program Files (x86)"\Java\jdk1.7.0_45\bin\
    and give the following command to find an SHA-1 fingerprint:
      > keytool -list -v -keystore "C:\Users\wenchen\.android\debug.keystore"
    It will ask for the keystore password, which is “android” in my case.


    Note that the SHA-1 fingerprints are not unique. You may create a fingerprint each time you create a Google API key.
Creating a Google API Project
Once you have your SHA-1 fingerprint, create or modify a project for your application in the
Google Developers Console and register for the Google Maps Android API:
  1. Navigate to the Google Developers Console.
  2. Create a project such as


    that you use to track your usage of the Google Maps Android API. Click the Project “MapMarker:”


  3. Pick “Use Google APIs:”


  4. Pick “Google Maps Android APIs:”


Obtaining a Google API Key
If your application is registered with the Google Maps Android API service, then you can request an API key. The key is free, you can use it with any of your applications that call the Maps API, and it supports an unlimited number of users. It is possible to register more than one key per project. Once you have the key, you add it to your application by adding an element to your application’s manifest file AndroidManifest.xml. To get the key, take the following steps:
  1. Create the credentials.
  2. You need credentials to access APIs. Enable the APIs you plan to use and then create the credentials they require. Depending on the API, you need

    • an API key, which identifies your project using a simple API key to check quota and access (for APIs like Google Maps),
    • a service account, which enables server-to-server, app-level authentication using robot accounts (for use with Google Cloud APIs), or
    • an OAuth 2.0 client ID, which requests user consent so your app can access the user’s data (for APIs like Google Calendar).


  3. Choose “API key:”


  4. Choose “Android key:”


  5. Create an Android API key.
  6. Get the package name from your AndroidManifest.xml file and enter the following information:

    • an API key name such as “Android key 1,”
    • the package name such as “com.wenchen.mapmarker,” and
    • the SHA-1 certificate fingerprint such as “12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:AA:BB:CC:DD .”


  7. The API key is generated.
  8. The Console responds by displaying a 39/40-character API key for Android apps. Copy this key value and you will use it in the AndroidManifest.xml file.


  9. Enable the API key.
  10. Do not forget to enable the API key. Without enabling the API key, the Google Play services (such as Google Maps) will not work for your app. It took me three days to figure it out. :(

Finally, the following image shows a list of projects created by me and the Console can be used to monitor the projects.
The key is associated with the project. The key will no longer be valid if you delete the project and re-create it. Instead, create another key for the same project, but with a different name. It took me several days to figure it out. :(