开发者

Google Maps Shows Up Grey

I know this has been asked before but I have read/tested for hours and I can't get my maps to show up! I generated the md5 and registered it which gave me the key I use in the code below. PLEASE HELP!!!!!! Here is the androidmanifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.libertytech.locatemycar"
  android:versionCode="1"
  android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
    <uses-library android:name="com.google.android.maps" />
    <activity android:name=".Home"
              android:label="@string/app_name"
              android:configChanges="orientation|keyboardHidden|keyboard">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.libertytech.locatemycar.GoogleMap" android:label="@string/app_name"
              android:theme="@android:style/Theme.NoTitleBar"
              android:configChanges="orientation|keyboardHidden|keyboard">
    </activity>
    <activity android:name="com.libertytech.locatemycar.Test" android:label="@string/app_name"
              >
    </activity>

</application>
<uses-permission android:name="android.permission.Internet"/>
<uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION"/>
<uses-permission and开发者_如何转开发roid:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk android:minSdkVersion="7" />
</manifest> 

Here is the googlemaps.xml

<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="006_T_R2vy70wILMHcCnAGiZoOe7jVjYM_xYtXA"
/>

All the required xml tags seem to be in the correct place. I have internet on the phone (I can browse the web). What am I missing?


Turns out that I needed to use android.permission.INTERNET not android.permission.Internet! It would be nice if Google could have given an error about missing permissions or something useful. It would have saved me hours and hours of work!


I will provide a check list. please ensure these things are correctly followed.

  1. Build Target platform used: It should be of Google API
  2. Emulator: You should use emulator of target Google not Android.
  3. MD5 Key: It should be generated from the same machine in which you are compiling the application. Also follow how to get mapview on the application detailed in this link: http://mobiforge.com/developing/story/using-google-maps-android


To get the app working in the emulator, then using an API key key generated from the debug keystore is OK.

To run the app on a phone you need a different Google API key; this must be generated from a private keystore which you have explicitly signed.

See section 1 of this link Signing Your Applications for details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜