Skip to main content
This page covers the SNA-only integration of the OTPless Headless SDK on Android. The SDK accepts the requestId generated by the Create API, performs the silent network handshake, and reports progress through callbacks. Your backend confirms the final result via the Status Check API.

Requirements

Step 1: Add SDK dependency

Add the OTPLESS SDK to your app’s build.gradle:
Check the latest version of the SDK here. Make sure to synchronize your Gradle project to fetch the dependency.

Step 2: Smart Authentication (SNA) setup

Make sure Silent Network Authentication is enabled on the OTPLESS dashboard. For an SNA-only configuration, SNA must be the only channel enabled.
Once the SDK is integrated, add the following line in your app’s AndroidManifest.xml inside the <application> tag:
AndroidManifest.xml

Step 3: Initialize the SDK

Import OtplessSDK in your LoginActivity.kt:
Initialize the SDK depending on your app architecture:
  • LoginActivity — initialize in onCreate()
  • LoginFragment — initialize in onViewCreated()
Replace APP_ID with your actual App ID from the OTPLESS dashboard.

Step 4: Start SNA with the requestId

Pass the requestId returned by the Create API to start():
Start polling the Status Check API from your backend immediately after calling start(). The SDK callback and the server status run in parallel.

Step 5: Handle callbacks

Callback reference

The SDK works in two steps — initialization and start() — and each step has its own set of callbacks.

Step 1: Initialization callbacks

Emitted when you initialize the SDK (Step 3).

Step 2: Start callbacks

Emitted after you invoke start() (Step 4).
In the SNA-only configuration AUTH_TERMINATED is a terminal failure with no fallback. Always treat the Status Check API result as authoritative. See Handling the AUTH_TERMINATED callback.
For the errorCode / statusCode values surfaced in SDK callbacks, see SDK Error Codes.

Next step

Status Check API

Confirm the authoritative auth status from your server.