Android – How to obtain Google API key for Windows ?
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 androiddebugkey –keystore <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.
Now you will get Google API key
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>
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/