Monday, October 7, 2013

2. As Google Map libraries are not part of Android libraries we need to mention library in AndroidManifest.xml file. Also we need to give permission to connect to internet. Open your AndroidManifest.xmlfile and modify as below.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
    package="com.androidhive.googlemaps"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk android:minSdkVersion="8" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
         
        <!--  Add Google Map Library -->
        <uses-library android:name="com.google.android.maps" />
         
        <activity
            android:label="@string/app_name"
            android:name=".AndroidGoogleMapsActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
 
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
     
    <!-- Allow to connect with internet -->
    <uses-permission android:name="android.permission.INTERNET" />
 
</manifest>
Obtaining Google Map Key
In order to use google maps you need to get map key. I am assuming you are working on windows PC. Now you need to get MD5 key from your jdk installation.

No comments:

Post a Comment