Found out the correct process for including a Google map in your Android application. The standard API key from the Google API website won’t work – you have to formulate a special MD5 hash and then generate an API key using the hash in order to get it up and running. Here are the step-by-step instructions:
- Using the command prompt (cmd.exe) in Windows 7, type in the following:
cd "C:\Documents and Settings\\.android"
- Once you are in the .android directory, type in the following command. Note that keytool is part of your JRE install – if it hasn’t properly been registered in your environment variables, you may have to declare the entire path as shown below:
"C:\Program Files\Java\\bin\keytool.exe"
-list -alias androiddebugkey -keystore
“C:\Users\\.android\debug.keystore”
-storepass android -keypass android
-list -alias androiddebugkey -keystore
“C:\Users\\.android\debug.keystore”
-storepass android -keypass android
- You’ll then get an MD5 hash like this one:
androiddebugkey, May 21, 2011, keyEntry, Certificate fingerprint (MD5):
79:12:66:0D:55:A0:C5:D3:EA:F1:5D:30:1D:C3:CB:B4
79:12:66:0D:55:A0:C5:D3:EA:F1:5D:30:1D:C3:CB:B4
- Plug in the hash into the following site and you’ll receive a valid Google Maps API key which will work in the emulator and in the Android SDK. To accomplish the same on a Mac, type in the following command in Terminal:
$ keytool -list -keystore ~/.android/debug.keystore
- If a password prompt comes up, type in “android”. You can then copy the MD5 hash and enter it on the Google Maps API key provisioning website. After all is said and done, here is what the map looks like on the Android 2.3.1 emulator:



