Skip to main content

Installation

Requirements

Android SDK

  • The minimum supported Android SDK version is 21.
  • The target Android SDK version is 33.

Hardware

Steps to integrate Contour AI SDK™ using a Gradle dependency

  • Open the app/build.gradle file and add contours JitPack dependency implementation.
implementation 'com.github.Contour-Document-Imaging:contours-ai-android-sdk:1.7.1'
  • In case of Kotlin Script add below JitPack dependency
implementation("com.github.Contour-Document-Imaging:contours-ai-android-sdk:1.7.1")
caution

Make sure that your applicationId matches the application id that was provided while requesting the license file.

  • Add these code block inside android { .. } in app/build.gradle like
packagingOptions {
pickFirst '/lib/armeabi-v7a/libopencv_java4.so'
pickFirst '/lib/arm64-v8a/libopencv_java4.so'
pickFirst '/lib/x86/libopencv_java4.so'
pickFirst '/lib/x86_64/libopencv_java4.so'
}
  • In case of Kotlin Script, add the following packagingOptions
packagingOptions {
jniLibs.pickFirsts.add("/lib/armeabi-v7a/libopencv_java4.so")
jniLibs.pickFirsts.add("/lib/arm64-v8a/libopencv_java4.so")
jniLibs.pickFirsts.add("/lib/x86/libopencv_java4.so")
jniLibs.pickFirsts.add("/lib/x86_64/libopencv_java4.so")
}
  • Open settings.gradle file and add the following code inside repositories or allRepositories section.
maven { url 'https://jitpack.io' }
  • In case of Kotlin Script, add the following maven url
maven { url = uri("https://jitpack.io") }
note

Sync the project to resolve compile errors or restart android studio.

Steps to integrate Contour AI SDK™ using an AAR file

  • You can find the latest version of the AAR file from Github. Please make sure to periodically check for updates to the SDK.
  • Create a new folder in the same directory where your 'app' module is located and name it the same as your .aar for example 'contours-ai-release' for 'contours-ai-release.aar'.
  • Paste the contours-ai-release.aar file in that directory.
  • Create a new file in the contours-ai-release directory and name it build.gradle Enter the following lines of code in that file.
configurations.maybeCreate("default")
artifacts.add("default", file('contours-ai-release.aar'))
  • At the project level settings.gradle file, change the line
include ':app'

to:-

include ':app' 
include ':contours-ai-release'
  • In the app module build.gradle file, add the following line in the depedencies section
implementation project(":contours-ai-release")
implementation 'com.github.Contour-Document-Imaging:opencv4:v4.6.1'
  • Open the settings.gradle file and add maven { url 'https://jitpack.io' } inside repositories or allRepositories section.
  • Put license file in the app/src/main/assets/ directory.
  • Add these code block inside android { .. } in app/build.gradle like
packagingOptions {
pickFirst '/lib/armeabi-v7a/libopencv_java4.so'
pickFirst '/lib/arm64-v8a/libopencv_java4.so'
pickFirst '/lib/x86/libopencv_java4.so'
pickFirst '/lib/x86_64/libopencv_java4.so'
}
  • If you get an error regarding multidex then
    • open build.gradle of your app module and set multiDexEnabled as true inside defaultConfig {}
    • add implementation "androidx.multidex:multidex:2.0.1" inside dependencies{} section of build.gradle file
note

Sync the project to resolve compile errors or restart android studio.

note

If you are using Jetpack Compose then follow the steps mentioned in the Installation using Gradle dependency section.

Steps to install the license

  • Place the licence file in app/src/main/assets.
  • The license file needs to have the name contoursAI.license. If the license file name does not match, it will lead to licensing errors.
  • Make sure that your ApplicationId matches the ApplicationId that was provided while requesting the license file.
note

You will need to acquire a license file to successfully use the Contour AI SDK™. Please contact your CSM at Urban FT to get your license file. You will need to provide your ApplicationID when requesting the license file. Get more information regarding our terms here.