1. Preparation: First configure the Android development Environment, then install the ArcGIS for Android development control in Eclipse ; Publish a local map service in Arccatalog.
2. After installing ArcGIS for Android development controls, a new project in eclipse will appear with the ArcGIS Project for Android option and the ArcGIS Samples for Android option. Here we choose Arcgisproject for Android.
3. Enter project name, next, the package name needs to be modified here, similar to the following: Com.esri. Project name. Activity. Pay special attention to choosing the TARGETSDK that matches your simulator here.
4. Click Done to create an ArcGIS for Android project in Eclipse, with the following structure:
Here is the 4.2.2 Android virtual machine, 10.2.3 version of the ArcGIS for Android plugin.
5. The next step is to show the map published in catalog in the adroid virtual. First, you need a control to put the map, Android is using Mapview, the specific code is as follows:
1 @Override2 Public voidonCreate (Bundle savedinstancestate) {3 Super. OnCreate (savedinstancestate);4 Setcontentview (r.layout.main);5 6Mmapview =NewMapview ( This);7Mmapview.setlayoutparams (Newlayoutparams (layoutparams.fill_parent, layoutparams.fill_parent));8Arcgisdynamicmapservicelayer MMAP =NewArcgisdynamicmapservicelayer ("HTTP//native IP address/arcgis/rest/services/achina/mapserver"));9 Mmapview.addlayer (MMAP);Ten Setcontentview (mmapview); One}
Note: The map service address is required to display the map, and you need to use the local IP address to access it.
6. Add the above code, save, run, you can display the following effect:
7.ok, the map shows, the next section is about how to remove the "Licensed for Developer using only" watermark and the use of Actionbar. Thank you.
Create a new ArcGIS for Android project and display a local map