> For the complete documentation index, see [llms.txt](https://docs.idlayr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idlayr.com/products/number-verification/discovery/integration/android.md).

# Android

{% hint style="info" %}
**Device API** · NV 1.0 · Early Access
{% endhint %}

The Android SDK is `idlayr-sdk-android` — the same artefact used for Secure SNA. For Discovery, the SDK pins the request to the cellular interface, follows the verification URL's redirect chain, and hands the resulting `code` back to your app. Your app then passes the code to your backend, which submits it to IDlayr and receives the discovered MSISDN in the response.

This page covers the device-side integration. For the backend role, see [Backend integration](/products/number-verification/discovery/integration/backend.md).

## 1. Install the SDK

Same SDK as Secure SNA — see the Android SDK installation page.

## 2. SDK initialisation

The Android SDK auto-initialises via `ContentProvider`. Access the singleton:

```kotlin
val sdk = IDlayrSDK.getInstance()
```

## 3. Obtain a verification URL

Your backend creates a Discovery check and **hands only the `url`** to your Android app, over your own application API. The OAuth2 access token never leaves your backend; the SDK doesn't need it. See [Backend integration](/products/number-verification/discovery/integration/backend.md).

## 4. Drive the verification

Use the SDK's Discovery method. The call drives the cellular-pinned request, follows the URL's redirect chain (plain HTTP, no `Authorization` header required), and hands the resulting `code` back to your app via a callback.

```kotlin
val sdk = IDlayrSDK.getInstance()

// SDK API for Discovery — exact method signature TBD.
// Conceptually: pass the discovery URL, and receive the outcome via
// a callback carrying the `code` and status on success, or an error.
// The MSISDN is not in the SDK's response; only your backend gets
// that (see step 6).
```

The SDK does not present any user-facing UI as part of the Discovery flow. Any confirmation prompt or number-display UX is application-side code you write after your backend has fetched the MSISDN (see step 7). See [User consent and displaying the number](/products/number-verification/discovery.md#user-consent-and-displaying-the-number) on the product page.

## 5. Response handling

```kotlin
// Conceptual:
// - On success: extract the `code` from response_body, forward it to
//   your backend (see step 6), then wait for your backend to give you
//   the MSISDN or terminal state to display.
// - On SDK error: see SDK error codes and route to a fallback.
```

## 6. Send the code to your backend

Pass the `code` to your backend over your own application API. Your backend submits the code to IDlayr's completion endpoint and receives the discovered MSISDN in the response — see [Backend integration → Submit the code](/products/number-verification/discovery/integration/backend.md).

## 7. Display the number (optional)

Once your backend has the MSISDN, you can pass it back down to the app if your UX calls for it — for example to show the user a "yes this is my number" confirmation. Whether to show the full number, a masked view, or skip the confirmation entirely is your choice.

## SDK errors

Same set as Secure SNA — `sdk_no_data_connectivity`, `sdk_connection_error`, `sdk_redirect_error`, `sdk_error`, `invalid_scheme`. See [SDK errors](/get-started/sdks/errors.md) for the cross-platform catalogue.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.idlayr.com/products/number-verification/discovery/integration/android.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
