Monday, April 4, 2011

Obtaining a Google Maps API Key for Android

When we using Google Map API for our android map project, we have to obtain a single Maps API key.That key is valid for every apps signed by a single certificate. So to obtain Maps API key we should provide certificate’s fingerprint.
 Obtain certificate’s fingerprint in Windows 7
  1. First go to C:\Users\username\.android directory there is file called debug.keystore we are going to use this file to generate certificate’s fingerprint.
  2. Open command prompt and enter following command on that
    keytool.exe -list -alias androiddebugkey -keystore "C:\Users\yourusername\.android\debug.keystore" -storepass android -keypass android
Obtain certificate’s fingerprint in Mac OSX or Linux
  1. In Linux or Mac OSX debug.keystore is in ~/.android directory
  2. Open terminal and enter following command on that
    keytool -list -keystore ~/.android/debug.keystore
Then it will give certificate fingerprint like following
After all go to the following site for obtaining Map API key
Follow the steps given bellow for obtain Map API key
  1. Then you can read and accept terms and conditions
  2. After that enter your certificate fingerprint in to given boxmapkey2
  3. Then click on Genarate API Key button
  4. Finally it will generate your keymapkey
Those are the steps that you have to follow for the obtain API key. You should copy this key and save  for future use. This key can be use in any kind of Android Google Map applications.