ArcGIS for Android 100.3.0(1):开发环境配置

官网

https://developers.arcgis.com/android/

ArcGIS for Android 100.3.0(1):开发环境配置_第1张图片

官方配置文档

https://developers.arcgis.com/android/latest/guide/install-and-set-up.htm

一.建议使用Gradle进行安装配置

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'

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" />

 <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>

二.官网下载sdk,进行离线配置

ArcGIS for Android 100.3.0(1):开发环境配置_第2张图片

下载完成后解压如下:

ArcGIS for Android 100.3.0(1):开发环境配置_第3张图片

ArcGIS for Android 100.3.0(1):开发环境配置_第4张图片

  1. 将aar目录下的arcgis-android-100.3.0.aar复制到android工程的lib目录下。

  2. 在build.gradle文件中配置

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.xiaoyehai.test11"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }

    repositories {
        flatDir{
            dirs 'libs'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation(name: 'arcgis-android-100.2.0', ext: 'aar')

}

3.添加权限

  <uses-permission android:name="android.permission.INTERNET" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

你可能感兴趣的:(ArcGIS for Android 100.3.0(1):开发环境配置)