【发布时间】:2011-01-05 15:00:05
【问题描述】:
我想为我的安卓手机学习一些编程。 我成功地制作了 hello world 应用程序。 现在我想试试这里的地图视图:http://developer.android.com/resources/tutorials/views/hello-mapview.html
我的代码如下:
package com.example.hellomapview;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ZoomControls;
import com.google.android.maps.*;
public class HelloMapView extends MapActivity {
/** Called when the activity is first created. */
LinearLayout linearLayout;
MapView mapView;
ZoomControls mZoom;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
linearLayout = (LinearLayout) findViewById(R.id.zoomview);
mapView = (MapView) findViewById(R.id.mapview);
mZoom = (ZoomControls) mapView.getZoomControls();
linearLayout.addView(mZoom);
setContentView(R.layout.main);
}
protected boolean isRouteDisplayed() { return false;}
}
我正在使用 eclipse,并且我已经正确安装了 SDK 和 AVD,但是一旦我执行运行->在 eclipse 中运行,它就可以开始了:
[2010-01-15 12:27:03 - HelloMapView]New emulator found: emulator-5554
[2010-01-15 12:27:03 - HelloMapView]Waiting for HOME ('android.process.acore') to be launched...
[2010-01-15 12:27:46 - HelloMapView]HOME is up on device 'emulator-5554'
[2010-01-15 12:27:46 - HelloMapView]Uploading HelloMapView.apk onto device 'emulator-5554'
[2010-01-15 12:27:46 - HelloMapView]Installing HelloMapView.apk...
The emulator comes up and I see my droid phone ready to load the HelloMapView app..but then it dies with the following:
[2010-01-15 12:27:51 - HelloMapView]Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2010-01-15 12:27:51 - HelloMapView]Please check logcat output for more details.
[2010-01-15 12:27:52 - HelloMapView]Launch canceled!
我从来没有做过任何 android 类型的开发,而且我来自 C# 背景,所以我的 java 是不确定的......但是有人看到我可能遗漏的任何东西吗?
【问题讨论】:
-
系统名为Android。 Droid 是摩托罗拉手机。
-
对,但我的手机机器人正在运行系统 android...我哪里出错了?
-
我的意思是标签:使用
android而不是droid。
标签: java android eclipse google-maps