Skip to content Skip to sidebar Skip to footer

Issues With Google Maps On Android Tutorial

Hey guys I've been trying to follow the tutorial that Google has on it's developers site on using Google Maps in Android. Needless to say I couldn't get the thing working and it ha

Solution 1:

Add following two lines before the MAP_KEY lines in AndroidManifest.xml

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

Solution 2:

1- First thing you must have insured that GOOGLE PLAY SERVICES are installed in your SDK or not.

for this open EclipseWinhowsAndroi SDK Manager and check whether you already have downloaded?

2- Import it into your Eclipse

for this in Eclipse goto FileImportAndroidExisting Android Code Into Workspace

and locate play services library project from

android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib

3- very important and main point for google map obtain a Google Map key

for that goto you Eclipse window tab > preferences > Android > Build and then copy your SHA-1 fingerprint.

then follow this link and then goto Services tab then search Google Map API v2 and turn that ON and same as for Goofle Play Android Dev API then nevigate to API ACCESS tab and then Create new Android key..

Thanks

Solution 3:

Firstly try using undermentioned under application section of manifest file ..

<meta-data
 android:name="com.google.android.gms.version"
 android:value="@integer/google_play_services_version" />

For Ex: Your manifest file ..

<?xml version="1.0" encoding="utf-8"?><manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.example.googlemapsdemov2"android:versionCode="1"android:versionName="1.0" ><uses-sdkandroid:minSdkVersion="14"android:targetSdkVersion="19" /><permissionandroid:name="com.example.googlemapsdemov2.permission.MAPS_RECEIVE"android:protectionLevel="signature"/><uses-permissionandroid:name="com.example.googlemapsdemov2.permission.MAPS_RECEIVE"/><uses-permissionandroid:name="android.permission.INTERNET"/><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permissionandroid:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/><!-- The following two permissions are not required to use
         Google Maps Android API v2, but are recommended. --><uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/><uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/><uses-featureandroid:glEsVersion="0x00020000"android:required="true"/><applicationandroid:allowBackup="true"android:icon="@drawable/ic_launcher"android:label="@string/app_name"android:theme="@style/AppTheme" ><meta-dataandroid:name="com.google.android.gms.version"android:value="@integer/google_play_services_version" /><!--Your Google API Key --><meta-dataandroid:name="com.google.android.maps.v2.API_KEY"android:value="AIzaSyAL5Xq8scMIHnWXITSOLN9QipVkri4A-lI"/><activityandroid:name="com.example.googlemapsdemov2.MainActivity"android:label="@string/app_name" ><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application></manifest>

Secondly if you are testing same on lower versions of android then you need to use SupportMapFragment for same. Try like this ..

<fragment
android:id="@+id/map"android:name="com.google.android.gms.maps.SupportMapFragment"android:layout_below="@+id/header"android:layout_width="match_parent"android:layout_height="match_parent"
    />

Hope it sorts your problem and let me know if any concern ..

Post a Comment for "Issues With Google Maps On Android Tutorial"