Android – How to obtain Google API key for Windows ?

There are some steps to obtain a Google API key for windows. The steps are described in detail below.
While you are developing and debugging your application, you will likely be sigining your application in debug mode — that is, the SDK build tools will automatically sign your application using the debug certificate. To let your MapView elements properly display Maps data during this period, you should obtain a temporary Maps API Key registered to the debug certificate. To generate an MD5 fingerprint of the debug certificate, first, locate the debug keystore. The default location of debug keystore is

C:\Documents and Settings\<user> .android\debug.keystore ( Windows XP )
C:\  Users \ .android \ debug.keystore (Windows 7 / Windows Vista)

C:Program FilesJavajdk1.6.0_25bin>keytool -list –alias androiddebugkeykeystore <path_of_debug.keystore> –storepass android –keypass android if you don’t find debug.keystore in the above location, then you can select Windows –> Preferences –> Android –> Build (In case of Eclipse) to check the full path of debug.keystore.
Now navigate the path of keytool.exe in command prompt. keytool.exe is located inside  Java –> JDK – > bin folder inside  program files. In command prompt window write the following command

The <path_of_debug.keystore> is path of debug.keystore . In my case, the path is C:UsersPradeep.androiddebug.keystore. It may be different for you. After writing the following command hit enter then result is obtained which is similar to

androiddebugkey, Dec 4, 2011, PrivateKeyEntry,
Certificate fingerprint (MD5): BE:05:C8:F2:42:7A:97:37:78:EE:BD:4A:31:7D:A6:69
Copy the fingerprint. Now, load the page http://code.google.com/android/maps-api-signup.html in your browser. Enter your Certificate fingerprint and hit “Generate API key” button.Fingerprint
Now you will get Google API key
apikey
Here is an example xml layout to get you started on your way to mapping glory:

 

<?xml version=”1.0″ encoding=”utf-8″?>

<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”

android:layout_width=”fill_parent”

android:layout_height=”fill_parent”>

<com.google.android.maps.MapView

android:id=”@+id/mapview1″

android:layout_width=”fill_parent”

android:layout_height=”fill_parent”

android:enabled=”true”

android:clickable=”true”

android:apiKey=”0ZzHJOolD-XzqDu5o4ZU5SBQo66sCis9eNTXd0g”

/>

</LinearLayout>

SHARE Android – How to obtain Google API key for Windows ?

You may also like...

1 Response

  1. Anonymous says:

    if u r using jdk1.7 than u will need a slightly changed command. explained in the following tutorial.
    http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-android-issues-and-errors-solved/

Leave a Reply

Your email address will not be published.

Share