我想为我的Android手机学习一些编程。
我成功地使用了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,但只要我执行run->在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是iffy…但有人看到什么,我可能会丢失?