Skip to main content

Getting started

Sample Project

If you prefer sample projects over documentation, check out our Docutain SDK Android Sample on Github.

Docutain SDK Dependencies

The Docutain SDK for Android is distributed through Maven repositories which you have to specify in your top-level build.gradle file:

allprojects {
repositories {
google()
//release versions of the Docutain SDK
mavenCentral()
//Snapshot versions of the Docutain SDK
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
}
caution

If you are using dependencyResolutionManagement with RepositoriesMode.FAIL_ON_PROJECT_REPOS in your settings.gradle file, make sure you have added the Docutain SDK repositories only in this specific block (instead of using allprojects repositories block in the build.gradle file):

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
//release versions of the Docutain SDK
mavenCentral()
//Snapshot versions of the Docutain SDK
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
}

Afterwards, you can add dependencies to your build.gradle file:

def docutainSdkVersion = '1.6.3.1'
//For Document Scanner components
implementation("de.docutain:Docutain-SDK-UI:$docutainSdkVersion")
//For Data Extraction and OCR (Text Recognition) components
implementation("de.docutain:Docutain-SDK-DataExtraction:$docutainSdkVersion")

The compileSdk of your app needs to be set to 34 or greater. Note that updating the compileSdk (which allows newer APIs to be used) can be done seperately from updating targetSdk and minSdk. So this should have no negative impact on your app.

Android Manifest

Camera Permission

If you want to use the Document Scanner, declare the following permission in your AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
info

Runtime permission for camera is handled automatically by the Docutain SDK.

Memory settings

Your application will work with high-resolution images. To avoid OutOfMemoryError exceptions it is highly recommended to set android:largeHeap="true" in the <application> element of your AndroidManifest.xml file.

<application android:largeHeap="true" ...>
...
</application>