Create a new Android project in Android Studio
Minimum SDK selection 4.0.3,arcgis Android 10.2.5 minimum supported version changed to 4.0, if not mistaken.
Add support for ArcGIS Android 10.2.5
Official Guide Links:
Https://developers.arcgis.com/android/guide/install-and-set-up.htm
Modify the project's Gradle file
allprojects { repositories { jcenter () // ADD The following ArcGIS repository maven { 'http://dl.bintray.com/esri/arcgis' } } }
Add dependencies for ArcGIS Android 10.2.5
Dependencies { ... // Add the ArcGIS Android 10.2.5 API ' com.esri.arcgis.android:arcgis-android:10.2.5 '}
APP Module Gradle File
Android { ... packagingoptions { 'meta-inf/lgpl2.1' meta-inf/ LICENSE 'meta-inf/notice'}}
Add the Androidmanifest.xml file in the
<uses-permission android:name="android.permission.INTERNET" /> < Uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-feature android:glesversion="0x00020000" android:required="true" />
Start Project
< Com.esri.android.map.MapView xmlns:android = "Http://schemas.android.com/apk/res/android" android:id= "@+id/mapview" android:layout_width= "Fill_parent" android:layout_height= "Fill_parent" />
Add a map control to XML
and add a map to the show.
Mapview Mmapview; Arcgistiledmapservicelayer tilelayer; @Overrideprotectedvoid onCreate (Bundle Savedinstancestate) { super. OnCreate (savedinstancestate); Setcontentview (r.layout.activity_main); Mmapview=(Mapview) Findviewbyid (R.id.mapview); New Arcgistiledmapservicelayer ( "Http://services.arcgisonline.com/ArcGIS/rest/services/World_ Street_map/mapserver "); // Add tiled layer to Mapview Mmapview.addlayer (tilelayer);}
Try adding a HelloWorld.
Let's take a look at the real-machine test.
Precautions:
1. Due to the loading of the Basemap, network access is required to ensure that WiFi or data networks are connected
2. Check the Enable GPU in the simulator creation option when testing simulator
It's done.
ArcGIS Android 10.2.5 Development environment configuration