> ## Documentation Index
> Fetch the complete documentation index at: https://docs.checkin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Android SDK

> Add identity verification to your Android app.

## Requirements

| | Minimum |
| - | - |
| Android | API 21 (Android 5.0) |
| `compileSdk` | 35 |
| Android Gradle Plugin | 8.6 |
| Kotlin | 2.0, if your app uses Kotlin |
| JDK | 17 |

This guide covers SDK version 4.2.8. NFC chip reading needs 4.2.x or newer.

## Install

Add the repositories in your settings file. A new Android Studio project already has `google()` and `mavenCentral()`; keep them. The SDK is hosted on `cdn.getid.cloud`, and JitPack is needed for one transitive dependency.

```kotlin settings.gradle.kts theme={null}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
        maven { url = uri("https://cdn.getid.cloud/sdk/android") }
    }
}
```

```groovy settings.gradle theme={null}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven { url "https://cdn.getid.cloud/sdk/android" }
    }
}
```

Then add the dependency to your app module:

```kotlin build.gradle.kts theme={null}
dependencies {
    implementation("ee.getid:getidlib:4.2.8")
}
```

```groovy build.gradle theme={null}
dependencies {
    implementation "ee.getid:getidlib:4.2.8"
}
```

The SDK ships its own ProGuard/R8 rules. You don't need to add keep rules.

### Permissions

The SDK merges `CAMERA`, `INTERNET`, `ACCESS_NETWORK_STATE`, `ACCESS_WIFI_STATE` and `VIBRATE` into your manifest, and asks the applicant for camera access when a camera step opens. Gallery upload uses the system photo picker, so no storage permission is needed.

If the flow has a video recording step, add the microphone permission yourself:

```xml AndroidManifest.xml theme={null}
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

Without it, the video step fails with `DENY_PERMISSION`.

## NFC

Only needed if the flow uses NFC. In `AndroidManifest.xml`:

```xml AndroidManifest.xml theme={null}
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />
```

`required="false"` keeps the app installable on devices without NFC. No intent filters are needed: the SDK handles tag discovery while the flow is in the foreground.

The NFC step is enabled per flow in the Backoffice: **Flows → \[flow name] → Customize → NFC**. NFC needs a physical device.

* If NFC is turned off, the SDK asks the applicant to turn it on in Settings and continues when they come back.
* If the device has no NFC and the flow doesn't require NFC, the step is skipped.
* If the device has no NFC and the flow requires NFC, the flow ends with `NO_NFC_SUPPORT`.

See [NFC chip reading](https://docs.checkin.com/products/nfc.md).

## Start the flow

Call `startVerificationFlow` from a user action, such as a button handler.

```kotlin Kotlin theme={null}
import com.sdk.getidlib.config.GetIDSDK
import com.sdk.getidlib.model.app.auth.Token

GetIDSDK().startVerificationFlow(
    context = this,
    apiUrl = "API_URL",
    auth = Token("JWT"),
    flowName = "FLOW_NAME",
    eventListener = listener
)
```

```java Java theme={null}
import com.sdk.getidlib.config.GetIDSDK;
import com.sdk.getidlib.model.app.auth.Token;

new GetIDSDK().startVerificationFlow(
    this,
    "API_URL",
    new Token("JWT"),
    "FLOW_NAME",
    null, // metadata
    null, // address
    null, // locale
    null, // dictionary
    null, // profileData
    null, // acceptableDocuments
    listener
);
```

In Java, pass every argument in this order and use `null` for the ones you don't need.

Only one flow runs at a time. Calling `startVerificationFlow` again before the flow completes, is cancelled or fails does nothing.

## Options

<table>
  <colgroup>
    <col width="209" />

    <col width="150" />

    <col width="325" />
  </colgroup>

  <thead>
    <tr>
      <th>Option</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**`context`** required</td>
      <td>`Context`</td>
      <td>An Activity or the application context</td>
    </tr>

    <tr>
      <td>**`apiUrl`** required</td>
      <td>`String`</td>
      <td>Environment URL, for example `https://partner.sb.getid.dev` or `https://partner.getid.ee`</td>
    </tr>

    <tr>
      <td>**`auth`** required</td>
      <td>`Token` or `Key`</td>
      <td>`Token("JWT")` with a session token from `POST /sdk/v2/token`. During development, `Key("SDK_KEY")` works instead; don't ship the SDK key in production apps. `Key` also takes an optional customer ID: `Key("SDK_KEY", "CUSTOMER_ID")`.</td>
    </tr>

    <tr>
      <td>**`flowName`** required</td>
      <td>`String`</td>
      <td>Flow name from the Backoffice</td>
    </tr>

    <tr>
      <td>**`locale`**</td>
      <td>`String`</td>
      <td>Language code, for example `en`, `de` or `ar_SA`. Overrides the device language. Unsupported languages fall back to the closest match, then English. See [Localization](https://docs.checkin.com/integrate/localization.md#supported-languages) for all codes.</td>
    </tr>

    <tr>
      <td>**`dictionary`**</td>
      <td>`String`</td>
      <td>Name of a custom translation dictionary. See [Localization](https://docs.checkin.com/integrate/localization.md#custom-translations).</td>
    </tr>

    <tr>
      <td>**`metadata`**`.externalId`</td>
      <td>`String`</td>
      <td>Your customer or session ID. Not unique.</td>
    </tr>

    <tr>
      <td>**`metadata`**`.labels`</td>
      <td>`Map<String, String>`</td>
      <td>Up to 30 string key-value pairs</td>
    </tr>

    <tr>
      <td>**`profileData`**</td>
      <td>`Map<String, String>`</td>
      <td>Known applicant data as key-value pairs, for cross-checking and prefilling. See [Profile data keys](https://docs.checkin.com/integrate/mobile/android.md#profile-data-keys).</td>
    </tr>

    <tr>
      <td>**`address`**`.country`</td>
      <td>`String`</td>
      <td>Expected address for [Proof of Address](https://docs.checkin.com/products/proof-of-address.md). ISO alpha-3. Required for the address to be used.</td>
    </tr>

    <tr>
      <td>**`address`**`.postcode`</td>
      <td>`String`</td>
      <td>Postcode</td>
    </tr>

    <tr>
      <td>**`address`**`.addressLine`</td>
      <td>`String`</td>
      <td>Street and house number, for example `Harju 1`. Required for the address to be used.</td>
    </tr>

    <tr>
      <td>**`address`**`.city`</td>
      <td>`String`</td>
      <td>City</td>
    </tr>

    <tr>
      <td>**`acceptableDocuments`**</td>
      <td>`Map<String, List<DocumentEnum>>`</td>
      <td>Narrows the flow's accepted documents for this session. Maps ISO alpha-3 country codes to document types, with a `"default"` key. See [Accepted documents](https://docs.checkin.com/integrate/mobile/android.md#accepted-documents).</td>
    </tr>

    <tr>
      <td>**`eventListener`**</td>
      <td>`BroadcastReceiverListener`</td>
      <td>Receives the [callbacks](https://docs.checkin.com/integrate/mobile/android.md#callbacks)</td>
    </tr>
  </tbody>
</table>

Pass `metadata` as `Metadata(externalId, labels)` and `address` as `Address(country, city, addressLine, postcode)`. Send the address as separate fields; the SDK doesn't parse a single address line. If `country` or `addressLine` is missing, the SDK ignores the address and the applicant enters it on the Proof of Address step.

### Profile data keys

`profileData` keys match field types in the flow, for example `first-name`. If the flow has a Profile Data step with a field of the same type, the value prefills that field and the applicant can edit it. The key must match the field type exactly. Values that don't match a form field are still submitted with the application.

The SDK formats these keys automatically:

`first-name`, `last-name`, `date-of-birth`, `gender`, `nationality`, `personal-number`, `document-number`, `date-of-issue`, `date-of-expiry`, `email`, `phone-number`, `address`, `postcode`, `city-of-residence`, `country-of-residence`.

Other keys, such as `account-number`, are passed as plain text. Dates are `YYYY-MM-DD`, `gender` is `male` or `female`, and countries are ISO alpha-3. Values longer than 256 characters are cut off.

### Accepted documents

`DocumentEnum` values: `PASSPORT`, `DOMESTIC_PASSPORT`, `DRIVING_LICENCE`, `ID_CARD`, `RESIDENCE_PERMIT`, `VOTER_CARD`.

* `acceptableDocuments` can only narrow what the flow accepts. It can't add documents or countries that the flow doesn't allow.
* Countries not in the map use the `"default"` list. Without a `"default"` key, countries not in the map aren't accepted.
* An empty list excludes that country.
* If nothing the flow allows remains after filtering, the SDK ignores `acceptableDocuments` and uses the flow's list.

## Callbacks

Implement `BroadcastReceiverListener` and pass it as `eventListener`.

<table>
  <colgroup>
    <col width="222" />

    <col width="182" />

    <col width="325" />
  </colgroup>

  <thead>
    <tr>
      <th>Callback</th>
      <th>Receives</th>
      <th>Called when</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**`verificationFlowStart`**</td>
      <td>—</td>
      <td>The flow has started</td>
    </tr>

    <tr>
      <td>**`verificationFlowComplete`**</td>
      <td>`GetIDApplication` with `applicationId`</td>
      <td>The applicant has submitted everything</td>
    </tr>

    <tr>
      <td>**`verificationFlowCancel`**</td>
      <td>—</td>
      <td>The applicant cancelled the flow</td>
    </tr>

    <tr>
      <td>**`verificationFlowFail`**</td>
      <td>`GetIDError`</td>
      <td>The flow can't continue. See [Errors](https://docs.checkin.com/integrate/mobile/android.md#errors).</td>
    </tr>
  </tbody>
</table>

Callbacks arrive on the main thread. The screen that started the flow may have been destroyed by then, so don't assume its views still exist.

The SDK doesn't return verification results. Get them on your server by [webhook](https://docs.checkin.com/integrate/results/webhooks.md) or [API](https://docs.checkin.com/integrate/results/retrieve-results.md).

## Errors

`verificationFlowFail` receives one of these `GetIDError` values:

<table>
  <colgroup>
    <col width="240" />

    <col width="260" />

    <col width="230" />
  </colgroup>

  <thead>
    <tr>
      <th>Error</th>
      <th>Meaning</th>
      <th>How to recover</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**`INVALID_KEY`**</td>
      <td>The SDK key is invalid.</td>
      <td>Check the SDK key.</td>
    </tr>

    <tr>
      <td>**`INVALID_TOKEN`**</td>
      <td>The JWT is empty or invalid.</td>
      <td>Generate a new JWT on your server.</td>
    </tr>

    <tr>
      <td>**`TOKEN_EXPIRED`**</td>
      <td>The JWT has expired.</td>
      <td>Generate a new JWT and start the flow again.</td>
    </tr>

    <tr>
      <td>**`FLOW_NOT_FOUND`**</td>
      <td>No flow with this name exists in this environment.</td>
      <td>Check `flowName` and `apiUrl`.</td>
    </tr>

    <tr>
      <td>**`UNSUPPORTED_SCHEMA_VERSION`**</td>
      <td>The flow configuration needs a newer SDK.</td>
      <td>Update the SDK.</td>
    </tr>

    <tr>
      <td>**`FAILED_TO_RECEIVE_CONFIGURATION`**</td>
      <td>The flow configuration is incomplete, for example a liveness step without a liveness token.</td>
      <td>Check the flow in the Backoffice.</td>
    </tr>

    <tr>
      <td>**`CUSTOMER_ID_ALREADY_EXIST`**</td>
      <td>An application with this customer ID already exists.</td>
      <td>Use a different customer ID.</td>
    </tr>

    <tr>
      <td>**`DENY_PERMISSION`**</td>
      <td>The applicant denied camera or microphone access, or the microphone permission is missing from the manifest.</td>
      <td>Ask the applicant to allow access in Settings, then start the flow again.</td>
    </tr>

    <tr>
      <td>**`INVALID_LIVENESS_TOKEN`**</td>
      <td>The liveness session token was rejected.</td>
      <td>Start the flow again.</td>
    </tr>

    <tr>
      <td>**`UNSUPPORTED_LIVENESS_VERSION`**</td>
      <td>The liveness service needs a newer SDK.</td>
      <td>Update the SDK.</td>
    </tr>

    <tr>
      <td>**`NO_NFC_SUPPORT`**</td>
      <td>The flow requires NFC and the device has no NFC.</td>
      <td>Ask the applicant to use a device with NFC.</td>
    </tr>

    <tr>
      <td>**`FAILED_TO_SEND_APPLICATION`**</td>
      <td>The application couldn't be submitted, usually because of the network.</td>
      <td>Check connectivity and start the flow again.</td>
    </tr>

    <tr>
      <td>**`UNEXPECTED_ERROR`**</td>
      <td>Any other error.</td>
      <td>Start the flow again. If it keeps happening, contact support.</td>
    </tr>
  </tbody>
</table>

## Full example

```kotlin Kotlin theme={null}
import com.sdk.getidlib.app.common.receivers.BroadcastReceiverListener
import com.sdk.getidlib.config.GetIDSDK
import com.sdk.getidlib.model.app.auth.Token
import com.sdk.getidlib.model.app.document.DocumentEnum
import com.sdk.getidlib.model.app.metadata.Metadata
import com.sdk.getidlib.model.app.proof_of_address.Address
import com.sdk.getidlib.model.entity.events.GetIDApplication
import com.sdk.getidlib.model.entity.events.GetIDError

GetIDSDK().startVerificationFlow(
    context = this,
    apiUrl = "https://partner.sb.getid.dev",
    auth = Token(sessionToken),
    flowName = "ID-Selfie-Liveness",
    locale = "en",
    dictionary = "my-dictionary",
    metadata = Metadata(
        externalId = "customer-123",
        labels = mapOf("journey" to "account-opening")
    ),
    profileData = mapOf(
        "first-name" to "Alex",
        "last-name" to "Example",
        "date-of-birth" to "1990-01-20"
    ),
    address = Address(
        country = "EST",
        city = "Tallinn",
        addressLine = "Harju 1",
        postcode = "10123"
    ),
    acceptableDocuments = mapOf(
        "EST" to listOf(DocumentEnum.PASSPORT, DocumentEnum.ID_CARD),
        "default" to listOf(DocumentEnum.PASSPORT)
    ),
    eventListener = object : BroadcastReceiverListener {
        override fun verificationFlowStart() {}

        override fun verificationFlowComplete(application: GetIDApplication) {
            notifyBackend(application.applicationId)
        }

        override fun verificationFlowCancel() {
            goBack()
        }

        override fun verificationFlowFail(error: GetIDError) {
            showError(error)
        }
    }
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.