---
title: Android SDK Lite
description: Run the Human Token capture natively in your Android app with the SDK Lite, using only the process token from your backend. No credentials in the app.
canonical: https://developer.unico.io/fr/human-token/integrations/app/android/sdk-lite
locale: fr
generated_by: markdown-export
---

Android SDK Lite

Open the Human Token capture natively in your Android app using only the webAppToken of the process.

The **SDK Lite** is the Unico Android SDK for the Human Token. It runs the capture in the Unico web experience embedded in the SDK and enters **only** with the `webAppToken` of a process created by your backend. The app holds no credentials: everything it needs comes from the token.

> **SDK version:** Available from **Android SDK 6.14.0** onwards, as the `io.unico:capture-lite` artifact.

### How it works

### Prerequisites

| Requirement | Version / value |
| --- | --- |
| Minimum Android | 5.0 (API 21) |
| Kotlin | 1.8.22 or later |
| Java compatibility | `JavaVersion.VERSION_1_8` |
| Android Gradle Plugin (AGP) | 8.6.0 or later |
| Android Studio | Koala Feature Drop (2024.1.2) or later |
| Required permissions | `INTERNET`, `CAMERA` |

- A backend that creates the process with [Create Process](/fr/human-token/api-reference/post-processes) and hands the `webAppToken` from the response to the app.
- Token entry enabled for your account by Unico in the target environment.

### Step 1: Add the dependency

The SDK Lite is distributed through the Unico Maven repository. Add the repository to the `dependencyResolutionManagement` block of your settings file, then add **`io.unico:capture-lite`** to the module-level build file:

- Kotlin DSL
- Groovy

settings.gradle.kts

```kotlin
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven("https://maven-sdk.unico.run/sdk-mobile")
    }
}
```

app/build.gradle.kts (module)

```kotlin
dependencies {
    implementation("io.unico:capture-lite:<version>")
}
```

settings.gradle

```gradle
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url "https://maven-sdk.unico.run/sdk-mobile" }
    }
}
```

app/build.gradle (module)

```gradle
dependencies {
    implementation 'io.unico:capture-lite:<version>'
}
```

### Step 2: Get the webAppToken from your backend

Your backend creates the process with [Create Process](/fr/human-token/api-reference/post-processes) and sends the app the **`webAppToken`** field of the response. The app passes it to the SDK as is. The `token` and `link` fields of the same response are for other uses: passed to the SDK, the `token` is rejected with error `73304`.

- **One process per journey.** Create a new process, and a new token, every time the user starts the capture.
- **Short-lived.** The `webAppToken` is valid for 5 minutes. Create it right before opening the capture.
- **Same environment.** The process and the SDK must use the same environment (UAT or PROD).

> **Avertissement:** Never embed credentials, access keys or a fixed token in the app. The `webAppToken` is created by your backend for each journey.

### Step 3: Open the capture

Get the `webAppToken` from your backend, build the SDK with `AcessoBio`, set the environment and call `prepareAndOpenCamera(webAppToken, listener)` with it. The call prepares the SDK and opens the capture at once.

```kotlin
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.acesso.acessobio_android.AcessoBioListener
import com.acesso.acessobio_android.iAcessoBioSelfie
import com.acesso.acessobio_android.onboarding.AcessoBio
import com.acesso.acessobio_android.onboarding.models.Environment
import com.acesso.acessobio_android.services.dto.ErrorBio
import com.acesso.acessobio_android.services.dto.ResultCamera
import com.acesso.acessobio_android.services.dto.SuccessResult
import kotlinx.coroutines.launch

class CaptureActivity : AppCompatActivity() {

    // Same environment used by your backend to create the process
    private val environment = Environment.PROD

    private val callback = object : AcessoBioListener {
        override fun onErrorAcessoBio(errorBio: ErrorBio?) { }
        override fun onUserClosedCameraManually() { }
        override fun onSystemClosedCameraTimeoutSession() { }
        override fun onSystemChangedTypeCameraTimeoutFaceInference() { }
    }

    private val selfieListener = object : iAcessoBioSelfie {
        // Journey result. Required.
        override fun onSuccess(successResult: SuccessResult) {
            // Journey completed: send successResult.processId to your backend
        }

        // Required by the interface. The journey result arrives in onSuccess.
        override fun onSuccessSelfie(result: ResultCamera) { }

        override fun onErrorSelfie(errorBio: ErrorBio) {
            // 73305 (expired token): create a new process and try again
        }
    }

    fun startCapture() {
        lifecycleScope.launch {
            // Your backend calls Create Process and returns the `webAppToken` field of the response
            val webAppToken = yourBackend.createHumanTokenProcess()

            val camera = AcessoBio(this@CaptureActivity, callback)
                .setEnvironment(environment)
                .build()
            camera.prepareAndOpenCamera(webAppToken, selfieListener)
        }
    }
}
```

> **OnSuccess is required:** `iAcessoBioSelfie` declares `onSuccess` with a default implementation, so the compiler does not require it. Without an override, the capture does not open and `onErrorSelfie` receives error `74001`.

- Prepare errors (rejected or expired token) and capture errors arrive in `onErrorSelfie`.
- The capture does not run on emulators (error `73006`).
- `onSuccess` signals that the journey ended, **not** that the user was approved. Always read the result with [Get Process](/fr/human-token/api-reference/get-process) or a webhook.

### Environment

The capture uses the environment set by `setEnvironment` on the builder. Use the environment where the process was created.

### Error codes

| Code | When | What to do |
| --- | --- | --- |
| `73006` | Running on an emulator | Test on a physical device |
| `73304` | The `webAppToken` is blank or was rejected (invalid signature or content), including when the `token` field is passed instead | Pass the `webAppToken` of a valid process |
| `73305` | The token expired | Create a new process and call `prepareAndOpenCamera` again with the new `webAppToken` |
| `73701` | The call is not available in the SDK Lite | Use `prepareAndOpenCamera(webAppToken, listener)` |
| `74001` | The listener does not override `onSuccess` | Override `onSuccess(successResult: SuccessResult)` |

### What's next

- Fetch the result with [Get Process](/fr/human-token/api-reference/get-process) and store `data.humanToken.value` with the user record.
- Can't use the SDK Lite? Open the journey `link` instead, as described in [Android](/fr/human-token/integrations/app/android/link-integration).
- Check the versions that include the lite edition in the [SDK Lite Release Notes](/fr/human-token/integrations/app/sdk-lite-release-notes).
- Integrating on iOS? See [iOS SDK Lite](/fr/human-token/integrations/app/ios/sdk-lite).

Dernière mise à jour le **12 nov. 2026**