我試圖讓GoogleMaps顯示在模擬器或我的Android設備上。無法讓GoogleMaps在Android上顯示
我已經經歷了一切關於這個在互聯網上,有沒有運氣
佈局 - main.xml中有apiKey我debug.keystore
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/myLocationText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<com.google.android.maps.MapView
android:id="@+id/myMapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
**android:apiKey="0QVYGuX4_0vLI8Uro3uUP3GYvG539JlObdsXxHA"**
/>
</LinearLayout>
該清單包括INTERNET和ACCESS_FINE_LOCATION權限
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jt.com.whereami">
<application
android:icon="@drawable/icon">
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".WhereAmI"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk android:minSdkVersion="7" />
</manifest>
地圖顯示出來,但只顯示框。
我使用Eclipse來開發,一切正常。
有什麼我失蹤了嗎?
調試鍵唯一作品使用debug.keystore,確保您正在運行應用程序,方法是右鍵單擊項目並選擇debug作爲android。如果密鑰錯誤,logcat中應該有與獲取地圖圖塊有關的例外情況。 – 2011-03-23 20:40:31
相同的東西.. Logcat中關於錯誤的內容不存在 調試爲android在模擬器和設備上都具有相同的結果。 – Bikeaccdnt 2011-03-23 20:58:40
您的.WhereAmI.java類擴展了MapActivity? – 2011-03-23 23:24:42