在我的应用程序中,我想显示地图。但它不显示我不知道它为什么表现。
实际上我首先通过在cmd
中运行cmd prompt
来获得API。首先我去了
c:\program files\java\jdk1.6.0\bin>keytool.exe -list -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator\.android\debug.keystore" -storepass android -keypass android
输入此cmd。我有这样的md5指纹
androiddebugkey, Jun 21, 2011, PrivateKeyEntry,
Certificate fingerprint (MD5): 87:A0:E9:D4:D6:C8:B1:E6:AB:D1:AD:DE:A7:03:B1:7F
所以我必须将这一个复制到http://code.google.com/android/maps-api-signup.html,我得到了这个API 00FpJatadwKOTgrosangJKa0bxxbHJBAUB_GyBA
。我把它放到像这样的xml中
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="00FpJatadwKOTgrosangJKa0bxxbHJBAUB_GyBA"
/>
我的java文件正在关注包
com.orb.google;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class GoogleActivity 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() {
// TODO Auto-generated method stub
return false;
}
}
我的清单文件也是这样的
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.orb.google"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".GoogleActivity"
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" />
</manifest>
所以,请帮助我为什么我无法在我的模拟器中获取谷歌地图,没有错误进入控制台和logcat文件。还已经开发的应用程序,它在另一个系统中显示地图,它无法在我的系统中显示地图。有什么问题请帮助我。谢谢你。
答案 0 :(得分:0)
如果您不使用此功能,请使用googleApi模拟器。