Thursday, July 12, 2012

Using Google Maps in Android

To use google map in our application follow the steps below:

  • Getting the MD5 Fingerprint of the SDK Debug Certificate    
          For getting the MD5 certificate open your command prompt 
                  * change the path to the jdk's bin ie. the command will be like  [ cd C:\your path\bin ]
                  * now type the command 
                       keytool -list -alias androiddebugkey -keystore "your debug key store path" -storepass android 
                        -keypass android
                  * 'your debug key store path' can be obtained from Eclipse-window>preferences>android>build.
  • Registering the Certificate Fingerprint with the Google Maps Service 
          For getting the API key using MD5 key go to http://code.google.com/android/maps-api-signup.html
and type your MD5 key there, accept the agreement and click the "Generate API Key" button.
  • Add the Maps API Key to your Application
         <com.google.android.maps.MapView android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:enabled="true"
                android:clickable="true"
                android:apiKey="example_Maps_ApiKey_String"/>


**  How to get MD5 fingerprint when you get  SHA1 from your command prompt???


    • While generating MD5 fingerprint for jdk version 1.7, it generates the fingerprint with SHA1  by default.But  the Google Maps doesn't recognize it.So you have to give the below command in the command prompt to get MD5 and SHA1 fingerprint.                                                               
    keytool -list -v -alias androiddebugkey -keystore "your debug key store path" -storepass android -keypass android

    1 comment:

    MVC - MVP : Difference between these design patterns?

    In traditional UI development - developer used to create a  View  using window or usercontrol or page and then write all logical code ...