Inside the SDK zip folder, move all the files located in the Libs > AWFramework > Dependencies folder into the libs folder for your application project.

Use the Custom, Packaged Libraries

Use the libraries provided in the SDK package. These libraries are custom and packaged to work with the SDK. The SDK does not work as designed if you replace the libraries with publicly available ones.

Set Up Gradle

Add the dependencies in your app-level Gradle build file. View the sample application for examples of an SDK file built with Gradle.

  1. Add the JAR and AAR files to the dependencies section, ensuring to change the names to match the names and versions of the library files.

    def supportLibraryVersion   = “26.1.0”
                            dependencies {
                            compile fileTree(dir: ‘libs’, include: [‘*.jar’])
                            compile "com.android.support:multidex:1.0.2"
                            //Integrate with ClientSDK: 
                            compile (name:‘AirWatchSDK-18.7’, ext:‘aar’)
                            //Integrate with AWFramework:
                            compile (name:‘CredentialsExt-18.7’, ext:‘aar’)
                            compile (name:‘AWFramework-18.7’, ext:‘aar’)
                            compile (name:‘SCEPClient-18.7’, ext:‘aar’)
                            compile "com.google.android.gms:play-services-safetynet:11.4.2"
                            compile "com.android.support:support-v13:${supportLibraryVersion}"
                            compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
                            compile "com.android.support:cardview-v7:${supportLibraryVersion}"
                            compile "com.android.support:recyclerview-v7:${supportLibraryVersion}"
                            compile "com.android.support:design:${supportLibraryVersion}"
                            compile "com.mixpanel.android:mixpanel-android:4.+"
                            compile "com.android.support:preference-v14:${supportLibraryVersion}"    
                            compile "net.zetetic:android-database-sqlcipher:3.5.7@aar"
                            }
                            
                            
                            
                         
  2. Add a packagingOptions block with these exclusions.

    packagingOptions {
                            exclude 'META-INF/LICENSE.txt'
                            exclude 'META-INF/NOTICE.txt'
                            }
                            
                            
                            
                         
  3. Add a dexOptions block with these values.

    dexOptions {
                            jumboMode = true
                            preDexLibraries false
                            javaMaxHeapSize "4g"
                            }
                            
                            
                            
                         
  4. Set the compileSDK to 26, the build tools to 26.0.1, and the targetSDKVersion to 25, all of which reside in the defaultConfig block.

    def compileSdk = 26
                            def buildTools = "26.0.1"
                            defaultConfig {
                            minSdkVersion 14
                            targetSdkVersion 25
                            multiDexEnabled true
                            vectorDrawables.useSupportLibrary = true
                            //to force fw to be merged with app when the aar included
                            consumerProguardFiles file('proguard.cfg')
                            ndk {
                            abiFilters "x86", "armeabi-v7a"//, "armeabi"
                            } 
                            }
                            
                            
                            
                         

    If the application needs to support ARMv6 devices (devices older than Ice-Cream Sandwich), then armeabi is required. For applications that only support ARMv7 devices (devices newer than Jelly Bean), it is not required. If you leave it commented out or you remove it, then the armeabi binaries are not included. Removing the armeabi binaries reduces the size of the APK by around 5 MB.

  5. Sync your project with the Gradle files.