我有这个清单文件
<permission android:name="com.mine.signedgooglemap.permission.MAPS_RECEIVE" android:protectionLevel="signature" /> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> <uses-permission android:name="com.mine.signedgooglemap.permission.MAPS_RECEIVE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"
/>
有了这个活动
package com.mine.signedgooglemap;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class signedgooglemapActivity extends MapActivity {
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected boolean isRouteDisplayed() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
}
我的 main.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="AIzaSyC0WDs0wXDuGwTipv6hDnbnIOObL9oR0Ms" />
我用我的密钥库签署应用程序然后我得到我的密钥库的 sha1 指纹并让谷歌控制台使用这条线 5B:66:36:BB:AE:44:3B:36:52:2D:88:6F 生成新的 api 密钥:A3:44:AD:3C:E4:0F:AB:5D;com.mine.signedgooglemap
我在调试器中收到此消息
02-05 10:56:15.228:WARN/System.err(873):IOException 处理:26 02-05 10:56:15.228:WARN/System.err(873):java.io.IOException:服务器返回:3 02-05 10:56:15.234: WARN/System.err(873): 在 android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115) 02-05 10:56:15.248: WARN/ System.err(873): 在 android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473) 02-05 10:56:15.254: WARN/System.err(873): 在 android_maps_conflict_avoidance .com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117) 02-05 10:56:15.268:WARN/System.err(873):在 android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher。服务请求(DataRequestDispatcher.java:994) 02-05 10:56:15.274: WARN/System.err(873): 在 android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702) 02-05 10:56: 15.274: WARN/System.err(873): 在 java.lang.Thread.run(Thread.java:1020)