我是新到Android development.please告訴我如何生成從關鍵store.I試圖谷歌地圖鍵的按鍵,但我得到的emulator.sorry以下錯誤你好谷歌地圖應用程序已停止,意想不到的如何在Android模擬器上顯示谷歌地圖?
我的代碼是::(HelloGoogleMaps.java)
package com.java4u.android;
import android.os.Bundle;
public class HelloGoogleMaps extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
您好谷歌地圖清單
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.java4u.android"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloGoogleMaps" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<uses-library android:name="com.google.android.maps" />
<uses-permission android:name="android.permission.INTERNET" />
</activity>
</application>
</manifest>
main.xml中
<?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="Your Maps API Key goes here"
/>
地圖Activity.java
package com.java4u.android;
import android.app.Activity;
public class MapActivity extends Activity {
protected boolean isRouteDisplayed() {
return false;
}
}
MapView.java
package com.java4u.android;
public class MapView {
public void setBuiltInZoomControls(boolean b) {
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
private MapView findViewById(int mapview) {
// TODO Auto-generated method stub
return null;
}
}
「對不起應用程序你好谷歌地圖已經意外停止「不是一個很好的錯誤描述。請看看您的LogCat視圖(在Eclipse中)或在控制檯中運行命令'adb logcat` ... – WarrenFaith 2011-06-17 10:34:36