Skip to main content

SmartComply Android SDK

The SmartComply Android SDK delivers a fully self-contained identity verification flow for Android apps. Launch one Activity and the SDK handles session management, country and ID-type selection, document capture, identity verification, and liveness detection automatically.

Features

  • Single-Activity launch — start verification with one Intent and receive a typed result back
  • Two verification modes — document photo capture or ID number data entry, configured from your Dashboard
  • Guide-box document capture — frames the ID card precisely so images are always clean and correctly cropped
  • Liveness detection — a passive camera scan (blink plus natural head movement) runs automatically after identity verification, with no step-by-step prompts
  • Dynamic ID types — channels and fields are fetched live from your Dashboard configuration
  • Multi-country support — renders a country picker automatically when more than one country is configured
  • Dark and light mode — theme adapts to the system setting; override via the launch intent

Requirements

  • Android API 24 (Android 7.0) or later
  • Kotlin 2.1 or later — the SDK is compiled with the Kotlin 2.1 toolchain, so an older consumer compiler rejects it
  • Java 17 — the SDK targets JVM 17
  • Jetpack Compose enabled in your module

Installation

1 — Add Maven Central

In settings.gradle.kts (already present in most projects):

2 — Add the dependency

In your app or feature module build.gradle.kts:
Use 1.0.5 or later. 1.0.3 and 1.0.4 crash the host app: both read HTTP responses on the main thread, and 1.0.3 additionally crashes when the SDK is closed from a UI callback. Neither can be withdrawn from Maven Central, so pin deliberately.

3 — Enable Compose


Credentials

Both values come from your Adhere Dashboard and both are permanent. Reuse the same pair for every verification.
clientId is not a per-attempt value. Generating your own UUID returns 404 SDK_CONFIG_NOT_FOUND on the very first call, because the server resolves it against an existing SDK Config record.

Permissions

The SDK declares these permissions automatically via manifest merge. You do not need to add them manually unless your project uses a custom manifest merge strategy:
SmartComplyActivity requests the CAMERA permission at runtime before it starts the flow, so if you launch through the Activity your app does not need to request it separately. If you embed SmartComplyFlowScreen directly, see Advanced: Custom Host Activity.

Quick Start

1 — Register the result launcher

In your Activity or Fragment:

2 — Launch verification

Jetpack Compose

If you are launching from a composable, use rememberLauncherForActivityResult:

buildIntent Parameters


Environments

SANDBOX targets a server running on the handset itself, for local backend development. It is not a hosted test environment. Use PRODUCTION for all integration work.
SmartComplyActivity.buildIntent defaults to PRODUCTION, but the SDKConfig constructor used by the embedded flow defaults to SANDBOX. Set environment explicitly when you construct SDKConfig yourself.

Result Extras

Read from the Intent returned to your activity result callback.
The result is a submission receipt, not a verification verdict. RESULT_STATUS is "processing" when the user finishes: face matching, document OCR and the government database check all continue after the Activity returns. An entry’s status moves through pending, processing, and then passed, failed or expired. The final outcome arrives via webhook.
TYPE_CANCELLED is returned whenever the user leaves via the back button, including from the success screen. Treat RESULT_ENTRY_ID as the only reliable handle on a run, and reconcile the outcome from the webhook.

Verification Flow

The SDK steps through these screens automatically.

Document images

Document photos are capped at 5 MB server-side, in JPG or PNG. Photos taken with the in-SDK camera are downscaled and compressed automatically. Images chosen with Upload from gallery are uploaded as-is, so a full-resolution phone photo can exceed the limit and fail with File too large. Maximum size is 5MB.

SDK Configuration


Error Handling

SmartComplyActivity handles and displays all error states inside the flow — an invalid key, an expired session, or an exhausted upload retry all render the SDK’s own failure screen with a Try Again button. The Activity returns a result only when the user completes the flow or backs out.

Advanced: Custom Host Activity

If you need to embed the verification flow directly inside your own ComponentActivity instead of launching a separate screen, you can use SmartComplyFlowScreen as a Compose composable:
Your host Activity must be a ComponentActivity and must be in the foreground with an active window. Embedding SmartComplyFlowScreen inside a Dialog or bottom sheet will cause the camera to fail on some devices.
You do not need to request CAMERA yourself. From 1.0.2 the composable routes through its own permission screen in both verification modes, before the ID-input or document-capture step, and skips it silently once the permission is granted.On 1.0.1 and earlier data mode never asked, so if the permission had not already been granted the camera never opened: the liveness preview stayed black and the flow ended with Recording failed: Recording finalized with error code 4. If you are pinned to an older version, request CAMERA yourself before entering the flow, or launch through SmartComplyActivity, which always asked for both modes.

Dependencies

From 1.0.3 the SDK no longer depends on Ktor. It uses OkHttp directly, so your own Ktor version cannot conflict with ours.
On 1.0.2 and earlier, an app that uses Ktor 3 crashes on launch:
Those versions were compiled against Ktor 2.3.12 and exported it, so Gradle resolved the conflict to your newer Ktor and linked our code against a version where the classes we call had been removed. There is no workaround on your side. Upgrade to 1.0.5.

ProGuard / R8

There is nothing to do. The SDK ships consumer ProGuard rules inside the AAR, so R8 applies them to your app automatically. They keep the generated kotlinx.serialization serializers and SmartComplyActivity; OkHttp ships its own rules in its jar.
On 1.0.1 and earlier, a minified build crashes on launch with a NoClassDefFoundError on a Ktor class. Those versions shipped no consumer rules. Upgrade to 1.0.5.