project build.gradle
// Add the following ArcGIS repository maven { url 'https://esri.bintray.com/arcgis' } maven { url "https://jitpack.io" }
Module build.gradle
packagingOptions { exclude 'META-INF/LGPL2.1' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' }
// Add ArcGIS Runtime SDK for Android dependency implementation 'com.esri.arcgis.android:arcgis-android:10.2.9'
Manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
mainActivity.java
onCreate()->initMap
ArcGISRuntime.setClientId("1eFHW78avlnRUPHm");//去除水印 mMapView.setEsriLogoVisible(false); mRightMapView.setEsriLogoVisible(false); //Color.parseColor("#333333"), Color.parseColor("#999999") mMapView.setMapBackground(Color.parseColor("#E3E4E5"), C.olor.parseColor("#E3E4E5"), 0, 0); mRightMapView.setMapBackground(Color.parseColor("#E3E4E5"), Color.parseColor("#E3E4E5"), 0, 0); mGraphicsLayer = new GraphicsLayer();