Apr 14, 2012

Google Maps API Key for Android (Eclipse, Windows)

There are two main types of keystores in Eclipse - one is for debugging (a keystore with no password) and the other one is when you create a new one yourself, with a password.

To make Google Maps work on your Android app, you need to enter a MD5 fingerprint of your keystore in Google Maps API signup: http://code.google.com/android/maps-api-signup.html

And here's how you get your keystore's MD5 fingerprint in Windows.

  1. You probably already have JDK installed. Find out your Java bin directory. Mine is:
    C:\Program Files\Java\jdk1.6.0_24\bin
  2. Enter this directory path in your PATH Environment variable (see picture).
  3. Start "cmd" and navigate to your
    C:\Users\<yourusername>\.android
    directory
  4. Type this command:
    keytool -list -keystore debug.keystore
  5. The password is empty, just hit enter
  6. You're done. Copy the MD5 fingerprint in that url, you get an API key, which you use in your Android MapView Layout file.
    android:apiKey="your api key here"

No comments: