Skip to main content
Kofax

Reference Android SDK Libraries

Article # 3037232 - Page views: 15

Issue

How to reference the mobile sdk libraries in Android

 

Solution

There are two different methods for referencing and using the SDK:

  • Use the JAR (both Eclipse and Android Studio)
  • Use the AAR (Android Studio)

These two methods have different implications and instructions.

Whether using the JAR or the AAR, if you're using Android Studio, ensure you have this line in the dependencies {} closure in the build.gradle file of the project:

compile fileTree(dir: 'libs', include: '*.jar')

To use the JAR:

  1. Get the entire MobileSDK_Libs/ folder contents and copy that into the libs/ folder of the project.
  2. Delete any .aar files in the copied version of the folder.
  3. Open the project's AndroidManifest.xml file.
  4. Inside the <application> node, add this XML:
    <meta-data android:name="roboguice.annotations.packages" android:value="com.kofax" />
    <meta-data android:name="roboguice.modules" android:value="com.kofax.mobile.sdk.capture.MainModule" />
  5. If using the Packaged Capture Experience, additional AndroidManifest modifications will be required.

To use the AAR file:

  1. Get the entire MobileSDK_Libs/ folder contents and copy that into the libs/ folder of the project.
  2. Delete the SDK JAR file.
  3. Add the libs folder as a flat file repository and the SDK reference by adding this to the project's dependencies {} closure:
    repositories {
       flatDir {
          dirs 'libs'
       }
    }
    compile(name:'sdk-release', ext:'aar')

 

Level of Complexity 

High

 

Applies to  

Product Version Build Environment Hardware
Mobile SDK all      

 

 

Article # 3037232
  • Was this article helpful?