Getting google map API Key for Android on Mac

Programming/App Development 2011. 5. 16. 02:40

From Thor

http://just-thor.com/2010/06/30/obtaining-google-android-map-api-key/

As a beginner on Android platform, I was trying to embed Google map in my application. I have everything right, except the map is not loading, and no exception was thrown at the console.

After doing some searching on the internet, my problem seems like caused by incorrect API key. Obtaining Android Map API key is different from normal Google Map API key. I assume you are running Android emulator and also a beginner(like me :D ), first step is to find out the location of your keystore. In Eclipse, fire up the “Preferences” window, and locate the Android->Build settings, you should see the location of your keystore file in the “Default debug keystore” field.

Type the following command in your command line. By the way, I am using Mac, I think *Nix user should have no problem running the following command, but for Windows Users, I think you need to find a way to do it.

keytool -list -keystore ~/.android/debug.keystore

and when it prompts you for the password, just hit the Enter key, no need to enter any password.
And you will get something like this in the output

Certificate fingerprint (MD5): 8E:6F:5D:3F:A9:94:96:69:42:D2: and more

copy the value of it, and go to this URL
http://code.google.com/intl/sv-SE/android/maps-api-signup.html

Paste your value into the textbox and submit, and you should be able to get your API key. By using this Android Map API key, I was able to get the map working in my Android apps. :)