Skip to content

Installation

Using Zip files

  1. Create a new Android project (or use an existing one).
  2. Import all provided .aar libraries into the app/libs directory:

    The following libraries must be included:

    genuine-ds-X.Y.Z.aar
    platform-common-definitions-X.Y.Z.aar
    platform-common-image-manipulation-X.Y.Z.aar
    platform-common-utils-X.Y.Z.aar
    platform-nativeds-X.Y.Z.aar
    sdk-camera-X.Y.Z.aar
    sdk-core-X.Y.Z.aar
    sdk-video-X.Y.Z.aar
    
  3. Add the SDK libraries to the app build.gradle dependencies:

    implementation(files("libs/genuine-ds-X.Y.Z.aar"))
    implementation(files("libs/platform-common-definitions-X.Y.Z.aar"))
    implementation(files("libs/platform-common-image-manipulation-X.Y.Z.aar"))
    implementation(files("libs/platform-common-utils-X.Y.Z.aar"))
    implementation(files("libs/platform-nativeds-X.Y.Z.aar"))
    implementation(files("libs/sdk-camera-X.Y.Z.aar"))
    implementation(files("libs/sdk-core-X.Y.Z.aar"))
    implementation(files("libs/sdk-video-X.Y.Z.aar"))
    
  4. Add the required Jetpack Compose dependencies.

    The SDK UI is built using Jetpack Compose. Since local .aar integrations do not automatically expose all transitive dependency metadata, the host application must explicitly include the required Compose dependencies:

    implementation(platform("androidx.compose:compose-bom:<version>"))
    implementation("androidx.compose.material3:material3")
    implementation("androidx.activity:activity-compose:<version>")
    implementation("androidx.lifecycle:lifecycle-runtime-compose:<version>")
    implementation("androidx.lifecycle:lifecycle-viewmodel-compose:<version>")
    
  5. Add the required external dependencies:

    implementation("com.google.ai.edge.litert:litert:<version>")
    implementation("com.google.mediapipe:tasks-vision:<version>")
    implementation("io.coil-kt:coil-compose:<version>")
    implementation("io.coil-kt:coil-gif:<version>")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:<version>")
    implementation("org.jetbrains.kotlin:kotlin-reflect:<version>")
    
  6. Use tested dependency versions

    Dependency Compatible version
    Compose BOM 2025.06.00
    Activity Compose 1.10.1
    Lifecycle 2.8.7
    LiteRT 1.4.1
    Media Pipe 0.10.32
    Coil Compose 2.6.0
    Kotlinx Serialization JSON 1.6.3
    Kotlin Reflect 1.9.25

    Newer versions may work, but compatibility should be validated by the integrator. This is especially important for Jetpack Compose dependencies, where incompatible module versions may lead to runtime errors such as NoSuchMethodError or NoClassDefFoundError.

  7. Sync the project with Gradle and build the application.

    android:largeHeap="true" is strongly recommended in the application manifest to improve memory availability during image processing flows.

Prepare the configuration

  • Provide a DocumentCaptureConfiguration instance (you can build it in code or load it from a JSON).
  • Ensure camera permission is defined in AndroidManifest.xml.

Minimal code usage

Import the SDK, create the configuration (programmatically or from JSON), and start the flow:

import androidx.activity.ComponentActivity
import com.veridas.sdk.video.entrypoint.VideoCapture
import com.veridas.sdk.video.entrypoint.VideoCaptureEventsListener
import com.veridas.sdk.video.entrypoint.VideoCaptureListener
import com.veridas.sdk.video.error.VideoCaptureError
import com.veridas.sdk.video.event.VideoCaptureEvent
import com.veridas.sdk.video.result.VideoCaptureResult

class VideoIntegratorActivity :
    ComponentActivity(),
    VideoCaptureListener,
    VideoCaptureEventsListener
{
    private companion object {
        private val TAG = VideoIntegratorActivity::class.simpleName
    }

    fun startCapture() {
        VideoCapture.start(
            listener = this,
            configuration = getConfigurationFromAsset(fileName),
            context = this
        )
        VideoCapture.setEventsListener(this)
    }

    // VideoCaptureListener
    override fun onVideoCaptureResults(results: VideoCaptureResult) {
        Log.i(TAG, "Video SDK -- onVideoCaptureResults $results")
    }

    override fun onVideoCaptureStarted() {
        Log.i(TAG, "Video SDK -- Started")
    }

    override fun onVideoCaptureFinished(error: VideoCaptureError?) {
        Log.i(TAG, "Video SDK -- onVideoCaptureFinished $error")
    }

    // VideoCaptureEventsListener
    override fun onVideoCaptureEvent(event: VideoCaptureEvent) {
        Log.i(TAG, "Video SDK -- onVideoCaptureEvent $event")
    }
}

Example helper for loading JSON configs (shared by all SDKs):

import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json

@OptIn(ExperimentalSerializationApi::class)
private val json = Json {
    ignoreUnknownKeys = true
    explicitNulls = false
}
fun getConfigurationFromAsset(fileName: String): VideoCaptureConfiguration {
    val jsonString = applicationContext
        .assets
        .open(fileName)
        .bufferedReader()
        .use { it.readText() }

    return json.decodeFromString<VideoCaptureConfiguration>(jsonString)
}

VideoCaptureListener covers onVideoCaptureResults, onVideoCaptureStarted, onVideoCaptureFinished, while VideoCaptureEventsListener can be implemented optionally to receive tracking events through onVideoCaptureEvent. Details are in the API section.