标签:android style blog http io ar color os sp
概述
虽然esri官网上最新版本是10.2.4,但是例子中实在是很难运行,总是出现各种各样的bug.又因为初学是Android,所以不想太浪费时间弄些配置了.决定先将v2.0.0的Arcgis for Android熟悉吧.
1,模拟器的参数的设定根据自己的这篇日志设定:Arcgis android - Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
2,通过New->Project->Arcgis for Android->Arcgis Project for Android的方式创建好默认的项目后,打开/src下的Activity.java文件,修改‘onCreate‘方法为:
1 @Override 2 public void onCreate(Bundle savedInstanceState) { 3 super.onCreate(savedInstanceState); 4 mMapView = new MapView(this);//实例化MapView对象 5 mMapView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 6 ArcGISTiledMapServiceLayer tileLayer = new 7 ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");//实例化图层 8 mMapView.addLayer(tileLayer); //添加图层到地图窗口中 9 setContentView(mMapView); 10 }
3,运行,结果为:
标签:android style blog http io ar color os sp
原文地址:http://www.cnblogs.com/listened/p/4129579.html