嗨,我是android中的新地图。我试着加载我的应用程序。我做了一切
生成密钥
清单文件中的权限。但只有一个普通的灰色网格即将到来。
我在这半天搜索了一下。并做了他们说的话。一切都是正确的。但我不知道地图是不是正在加载......我真的很担心这个......请帮帮我..谢谢。
我生成MD5 FInger打印的命令:
keytool -list -alias androiddebugkey -keystore "C:\Documents and Settings\Admin\.android\debug.keystore"\ -storepass android -keypass android
我的清单文件:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.map"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INERNET" />
<uses-permission android:name="android.permission.WRITE_GSERVICES" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".Mapcctivity"
android:label="@string/title_activity_mapcctivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我的活动档案:
public class Mapcctivity extends MapActivity {
private MapView mMapView = null;
private MapController mc = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// mMapView = new MapView(this, "0FTpADSJRjSkczl5Jd4E8yoTlhthq6np5gPQClQ");
setContentView(R.layout.ssss);
// MapView mp=new MapView(this,"0FTpADSJRjSmVNLeQhafHG_AHJD9mo5lAEsJ_KQ");
GeoPoint gPoint = new GeoPoint(19240000,-99120000);
mMapView = (MapView) findViewById(R.id.mapview);
mMapView.setSatellite(true);
mMapView.setBuiltInZoomControls(true);
mc = mMapView.getController();
mc.setZoom(15);
mc.setCenter(gPoint);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
我的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<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="My generated key"
/>
加载地图时,我的logcat如下:
12-04 09:42:09.553: E/ActivityThread(285): Failed to find provider info for com.google.settings
12-04 09:42:09.563: E/ActivityThread(285): Failed to find provider info for com.google.settings
12-04 09:42:09.673: E/ActivityThread(285): Failed to find provider info for com.google.settings
12-04 09:42:10.583: D/dalvikvm(285): GC freed 1891 objects / 125528 bytes in 140ms
12-04 09:42:11.213: I/MapActivity(285): Handling network change notification:CONNECTED
12-04 09:42:11.213: E/MapActivity(285): Couldn't get connection factory client
12-04 09:42:12.093: D/dalvikvm(285): GC freed 4623 objects / 271376 bytes in 149ms
12-04 09:42:16.403: D/dalvikvm(285): GC freed 13753 objects / 921216 bytes in 175ms
12-04 09:42:26.873: D/dalvikvm(285): GC freed 9400 objects / 642912 bytes in 181ms
请帮我解决这个问题..
答案 0 :(得分:0)
生成地图密钥如下:
1。Go to this link and generate MD5 fingerprint
2。Click on this link you will get map key using generated MD5 fingerprint
3.在xml文件中使用此密钥。
答案 1 :(得分:0)
组
android:minSdkVersion="8"
在你的清单中。
答案 2 :(得分:0)
感谢所有的家伙......我得到了解决这个问题。我找到解决方案后真的很烦恼..
问题是:
在我的清单文件中查看权限.. For "INTERNET" i misspelled as "INERNET"
...这个罪魁祸首就是问题..