> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.id.me/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.id.me/_mcp/server.

# Android SDK

> Learn how to integrate and use ID.me's native SDK for Android

> **Prerequisites**
>
> Before integrating the SDK, ensure your development environment meets the following requirements:
>
> * Android Target API Level: `36`
> * Gradle version: `8.14.3`
>
> Kotlin version : `2.x+`

# Adding the SDK to your project

Add the following to your project-level `build.gradle` file:

```kotlin
allprojects {
    repositories {
        maven {
            name = "IDmeSDK"
            url = uri("https://us-maven.pkg.dev/idme-public-artifacts-5581/all")
        }
    }
}
```

Add the following to your app-level `build.gradle` file:

```kotlin
dependencies {
    implementation 'me.id.sdk:idme-sdk-android:<version>' // latest version is 0.9.0
}
```

If your app uses `OkHttp`, add the following block to your app-level `build.gradle` file:

```
configurations.all {
    resolutionStrategy {
        eachDependency {
            if (requested.group == "com.squareup.okhttp3" && requested.name == "okhttp-jvm") {
            useTarget("com.squareup.okhttp3:okhttp:${requested.version}")
            because("choosing okhttp over okhttp-jvm")
            }
        }
    }
}
```

Sync your Gradle project

# Required app integration steps

Our SDK will automatically request the permissions that it needs. If your application explicitly removes permissions, please ensure that `CAMERA` and `RECORD_AUDIO` are not removed.

Our SDK automatically requests and uses `FOREGROUND_SERVICE_DATA_SYNC`. You must declare the foreground service information within the Play Console (it is located under Policy -> App Content -> Foreground Service Permissions). Please follow the instructions outlined by Google Play [here](https://support.google.com/googleplay/android-developer/answer/13392821?hl=en#declare) to ensure your application is compliant. These steps are:

1. Provide a description of the app functionality that is using each foreground service type. You may supply the following description: *“Our application uses the foreground service to upload end-user data to our servers for verification purposes”*.
2. Describe the user impact if the task is deferred by the system (does not start immediately) or the task is interrupted by the system (paused or restarted). You may supply the following description: *“If the task is deferred or interrupted by the system, the end-user verification will be delayed”*.
3. Choose your specific use case for each foreground service type. You may select the following use case: *”Other”* under *”Network Processing”*.
4. Include a link to a video demonstrating each foreground service feature. You may record a video of the verification flow and provide a link to this video.

Within the app level `build.gradle`, you will need to add the following entry:

```kotlin
android {
    defaultConfig {
        manifestPlaceholders["appAuthRedirectScheme"] = "<insert package name>"
    }
}
```

# Initialization

To initialize the SDK, create a subclass of the `Application` class, and add the following code to your `onCreate()` method:

```kotlin
class SampleApp : Application() {
	override fun onCreate() {
		super.onCreate()
		IDmeSDK.init(this.applicationContext, sdkConfig)
	}
}
```

You will need to pass in an instance of `IDMeSDKConfig` while initializing the SDK. This example demonstrates how to create this config:

```kotlin
val sdkConfig = IDmeSDKConfig(
	externalUserId = "sample-user-id", // Unique identifier for the user
	appName = "SampleApp", // Name of the app
	tokenProvider = ::tokenProvider
)
```

The `tokenProvider` in the example is responsible for generating the client access token. This token enables the SDK to make REST API requests to ID.me's backend APIs. The application must obtain a client access token from ID.me and provide a function to generate a new token if the current one expires. The SDK will then automatically use this to make REST API requests. This example illustrates the signature of this token provider method:

```kotlin
suspend fun tokenProvider(): String = withContext(Dispatchers.IO) {
	// Fetch client token from the backend and return it
}
```

# Common usage patterns

This section provides examples of common tasks you can perform with our Mobile SDK.

## Performing legal document and face liveness verification

This section details the process of legal document and face liveness verification utilizing our Mobile SDK. Initiating a verification is straightforward, as demonstrated by the code snippets below.

```kotlin
idmeSDK.verificationsManager.beginVerification(VerificationType.DOCUMENT)

idmeSDK.verificationsManager.beginVerification(VerificationType.FACE_LIVENESS)
```

Once the verification is complete, you will receive a result, which contains the following fields:

```kotlin
VerificationResult {
	verificationId: // The local ID of the verification
    serverVerificationId: // The server verification ID of the verification
	verificationStatus: // The status of the verification
	errorCode: // Error code if the verification failed, null otherwise
	errorMessage: // Error message if the verification failed, null otherwise
	credentialId: // ID that can be used to fetch the document from ID.me's credentials REST API endpoint, null if the verification failed
    nfcData: //NFC data extracted during document verification (null if not available or extraction failed). Contains Base64-encoded DG1 (MRZ data) and DG2 (face image)
    nfcExtractionFailed: // Indicates if NFC extraction was attempted but failed
}
```

## Checking the status of an ongoing verification

This section describes how to obtain the status of an ongoing verification.

```kotlin
// Returns the verificationID and status of all the ongoing verifications
idmeSDK.verificationsManager.getAllVerifications()
```

## Customizing the user interface

This section details how to customize the user interface. While default values are based on ID.me's design system, you have the flexibility to replace any or all of these to align with your application's aesthetic. We provide customization options for the following elements:

* **Colors**: Modify the color scheme of various interface elements.
* **Button Radius**: Control the roundness of buttons within the Mobile SDK.
* **Logo**: Replace the default ID.me logo with your application's logo.
* **Fonts**: Choose the fonts used for all text displayed in the document scanner interface.

**`The following optional fields are available for customization`**

```kotlin The following optional fields are available for customization
idmeSDK.verificationsManager.setBaseUIConfig(
	IdmeBaseUIConfig(
		colors = IDmeBaseColors(
			background = Color(<insert hex>).toArgb(),
			onBackground = Color(<insert hex>).toArgb(),
			onBackgroundSecondary = Color(<insert hex>).toArgb(),
			onBackgroundTertiary = Color(<insert hex>).toArgb(),
			primary = Color(<insert hex>).toArgb(),
			onPrimary = Color(<insert hex>).toArgb(),
			secondary = Color(<insert hex>).toArgb(),
			onSecondary = Color(<insert hex>).toArgb(),
			outline = Color(<insert hex>).toArgb(),
			success = Color(<insert hex>).toArgb(),
			error = Color(<insert hex>).toArgb()
		),
		buttonRadius = <insert button radius>,
		logo = <insert logo>,
		fonts = IDmeFonts(
			regular = <insert font>,
			medium = <insert font>,
			bold = <insert font>
		)
	)
)

idmeSDK.verificationsManager.setDocScanUIConfig()

idmeSDK.verificationsManager.setFaceLivenessUIConfig()

```

# Support

> **Note**
>
> If you encounter any issues or have questions, please contact our developer support team. You can reach us at [mobile-sdk-issues@id.me](mailto:mobile-sdk-issues@id.me).