Saturday, March 31, 2012

Setting up Google Maps in Android development.


First to generate the google maps we need to have googleAPI's jar .
next the main.xml file will be like this

 <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="07U1v4ybO9ld4IUYE6s1mzC867e9U9xLOm3lDDw"
        />



here ApiKey is genereted from the google maps site   http://code.google.com/android/add-ons/google-apis/mapkey.html

 Before that you need to generated the MD5 finger print .

This can be generated like this

Go to your WindowsPreference --->Android --->Build --->Copy the path from Default Debug keystore
It is looks like C:\Users\Maazeed\.android\debug.keystore .
Now in commad prompt we need to run the below following lines.
To get MD5 Finger print send the path of debug keystore.


keytool.exe -list -alias androiddebugkey -keystore "C:\Users\Maazeed\.android\debug.keystore" -storepass android -keypass android 






Now you get the MD5 Finger print  similarly like this

MD5 Finger print :
5F:52:33:3A:CF:66:F0:C5:2B:9A:6F:BE:EF:2B:A5:DF

Here we go we need copy and paste the sequence in this link
http://code.google.com/android/add-ons/google-apis/mapkey.html

Now you will generate the ApiKey .That looks like this .

Key generated :
07U1v4ybO9ld4IUYE6s1mzC867e9U9xLOm3lDDw

This is the APIkey you seen in first para of the discussion.

Now you can play what ever you want with the code.









No comments:

Post a Comment