1.在Project的build.gradle文件中进行以下配置:
allprojects {
repositories {
google()
jcenter()
// Add the following ArcGIS repository
maven {
url 'https://esri.bintray.com/arcgis'
}
}
}
2.在module的build.gradle中添加依赖:
// Add ArcGIS Runtime SDK for Android dependency
implementation 'com.esri.arcgisruntime:arcgis-android:100.3.0'
添加packagingOptions
packagingOptions {
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
和 JDK 1.8支持
// Add below lines to set compatibility with Java 8 language features for an Android app module.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
3.在清单文件AndroidManifest.xml中添加:
<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" />
// Apps that use a GeoView will require using OpenGL 2.x:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
// Apps that use Viewshed or LineOfSight will require using OpenGL 3.x:
<uses-feature
android:glEsVersion="0x00030000"
android:required="true"/>
参考文档:https://developers.arcgis.com/android/latest/guide/install-and-set-up.htm
网友评论