Google Maps Activity V2 Android Studio

fsch

I have troubles with integrating Google Maps API v2 into my app.

I'm using Android Studio. I created a new maps activity and followed the instructions stated in the google_maps_api.xml:

<resources>
    <string name="google_maps_key_instructions">
    <!--
    TODO: Before you run your application, you need a Google Maps API key.

    To get one, follow this link, follow the directions and press "Create" at the end:

https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=XXXXhashXXX%3Bat.schickermueller.taxameter.activity

    You can also add your credentials to an existing key, using this line:    
    XXXXhashXXX;at.schickermueller.taxameter.activity

    Once you have your key (it starts with "AIza"), replace the "google_maps_key"
    string in this file.
    -->
    </string>
    <string name="google_maps_key" templateMergeStrategy="preserve">AIzaXXXXXXXXXXXXXXXXXXXXX</string>
</resources>

I also activated the Android maps v2 API:

but the activity shows a blank map and there is the following error:

08-23 12:30:45.845 11659-11829/at.schickermueller.taxameter E/Google Maps Android API﹕ Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

I already tried some 'solutions' posted in stack overflow threads(like Android - Google maps Api v2 - Authentication error)

My manifest has the following content:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="at.schickermueller.taxameter" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".activity.StartActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name=".service.TrackService"
            android:enabled="true"
            android:exported="true" >
        </service>

        <activity
            android:name=".activity.DriveListActivity"
            android:label="@string/title_activity_drive_list" >
        </activity>
        <activity
            android:name=".activity.DriveDetailActivity"
            android:label="@string/title_activity_drive_detail"
            android:theme="@style/Theme.AppCompat" >
        </activity>

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

        <activity
            android:name=".activity.MapsActivity2"
            android:label="@string/title_activity_maps_activity2" >
        </activity>
    </application>

    <permission
        android:name="at.schickermueller.taxameter.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="at.schickermueller.taxameter.activity.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <!--
         The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but are recommended.
    -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

</manifest>

I hope you can help me

Hafizh Herdi

Make sure you already registered your SH1 key and your package name 'at.schickermueller.taxameter' in the APIs console correspond to your API key. Or use a API key that's available to all devices.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Google Maps Android API v2

分類Dev

Google maps v2 not displayed on new activity

分類Dev

Google Maps Android API v2 Authorization failure

分類Dev

Can't connect to Google Maps Api Android V2

分類Dev

Overlay an image on google maps android api v2

分類Dev

Android 2.3およびgoogle maps API v2

分類Dev

Circle on Google Maps for Android v2 is flickering when size changes by seekbar

分類Dev

Android Google Maps API v2:方位位置を取得する

分類Dev

How to animate the camera to a specified location in Google Maps v2 for Android?

分類Dev

Adding Multiple Markers in real time google maps v2 android

分類Dev

Android google maps v2 execute asynctask when user stops moving the camera

分類Dev

How to manage Markers well using google maps api v2 on android

分類Dev

Google android maps api v2マーカータイトルを常に表示

分類Dev

Animated Transparent Circle on Google Maps v2 is NOT animating correctly

分類Dev

How to set api key for Google maps v2

分類Dev

Google Maps V2 - API key not found Error Message

分類Dev

android maps api v2 adding multiple circles

分類Dev

access maps v2 with calabash-android

分類Dev

access maps v2 with calabash-android

分類Dev

Google Maps Android API v2のMapFragmentにカスタムコントロールを追加する方法

分類Dev

Google Maps V2 Androidでマーカーのアイコンのサイズを指定する方法

分類Dev

Google Maps V2 Androidでマーカーのアイコンのサイズを指定する方法

分類Dev

Google Maps V2 Androidでマーカーのアイコンのサイズを指定する方法

分類Dev

Android Google Maps v2:マーカーサイズをアニメーション化

分類Dev

Google Maps Android API V2で白地図しか入手できないのはなぜですか?

分類Dev

Android Google Maps v2は、JSON配列phpmySQLからマップマーカーを追加します

分類Dev

Android google map v2 error at marker's icon

分類Dev

Google map API v2 Android - Markers & scale

分類Dev

How to change Language on Android google map V2 api

Related 関連記事

  1. 1

    Google Maps Android API v2

  2. 2

    Google maps v2 not displayed on new activity

  3. 3

    Google Maps Android API v2 Authorization failure

  4. 4

    Can't connect to Google Maps Api Android V2

  5. 5

    Overlay an image on google maps android api v2

  6. 6

    Android 2.3およびgoogle maps API v2

  7. 7

    Circle on Google Maps for Android v2 is flickering when size changes by seekbar

  8. 8

    Android Google Maps API v2:方位位置を取得する

  9. 9

    How to animate the camera to a specified location in Google Maps v2 for Android?

  10. 10

    Adding Multiple Markers in real time google maps v2 android

  11. 11

    Android google maps v2 execute asynctask when user stops moving the camera

  12. 12

    How to manage Markers well using google maps api v2 on android

  13. 13

    Google android maps api v2マーカータイトルを常に表示

  14. 14

    Animated Transparent Circle on Google Maps v2 is NOT animating correctly

  15. 15

    How to set api key for Google maps v2

  16. 16

    Google Maps V2 - API key not found Error Message

  17. 17

    android maps api v2 adding multiple circles

  18. 18

    access maps v2 with calabash-android

  19. 19

    access maps v2 with calabash-android

  20. 20

    Google Maps Android API v2のMapFragmentにカスタムコントロールを追加する方法

  21. 21

    Google Maps V2 Androidでマーカーのアイコンのサイズを指定する方法

  22. 22

    Google Maps V2 Androidでマーカーのアイコンのサイズを指定する方法

  23. 23

    Google Maps V2 Androidでマーカーのアイコンのサイズを指定する方法

  24. 24

    Android Google Maps v2:マーカーサイズをアニメーション化

  25. 25

    Google Maps Android API V2で白地図しか入手できないのはなぜですか?

  26. 26

    Android Google Maps v2は、JSON配列phpmySQLからマップマーカーを追加します

  27. 27

    Android google map v2 error at marker's icon

  28. 28

    Google map API v2 Android - Markers & scale

  29. 29

    How to change Language on Android google map V2 api

ホットタグ

アーカイブ