Skip to content

Steps to reference local ArcGIS runtime SDK for Android

Garima Dhakal edited this page Jun 23, 2015 · 13 revisions

I would like to provide following steps to reference local ArcGIS runtimer SDK for Android.

  1. Download the SDK from Developers site: https://developers.arcgis.com/en/sign-in/

  2. Create an Android project in Android Studio.

  3. Add native libs:
    3.a) Create a /src/main/jniLibs/ folder in your app module.
    3.b) From the root of your SDK download directory, copy the /libs/[platform]/folder into the jniLibs folder created in the step above. Here, platform refers to the platform architecture your device is running (armeabi, armeabi-v7a, and x86). Total folders=3.
    3.c) Copy jar files from <android-sdk)/libs/ folder to /app/libs/ folder. Total jar files=5.

  4. Update dependencies of your app's module.
    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile fileTree(include: ['**'], dir: 'jniLibs')
    compile 'com.android.support:appcompat-v7:22.2.0'
    }

  5. Gradle may complain about duplicate files in your build apk. You can exclude those files by adding the packagingOptions directive to the android closure in your app module build.gradle file:
    android {
    ...
    packagingOptions {
    exclude 'META-INF/LGPL2.1'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
    }
    }

  6. Required permissions and features.
    <manifest …..
    <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" />
    ….
    </manifest>