> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-payment/integrate-d1-sdk/getting-started/configuration/1.-binary-integration/android.md).

# Android

D1 SDK is released in two variants: debug and release.

{% code lineNumbers="true" %}

```
<d1-release-package>
├── binaries
│   ├── d1-debug.aar
│   └── d1-release.aar
└── javadoc
│   └── ...
```

{% endcode %}

This guide is tested with the following environments:

* Android Studio Narwhal
* Android Gradle Plugin 8.7.0

To integrate D1 SDK into your Android issuer application:

{% stepper %}
{% step %}

### Copy the AAR files

Copy all files from `<d1-release-package>/binaries` into the `libs` folder in your project. Create `libs` if needed.

Your project should look like this:

{% code lineNumbers="true" %}

```
├── app
│   └── libs
│       ├── d1-debug.aar
│       └── d1-release.aar
│   └── ...
├── gradle
│   └── ...
├── build.gradle
├── gradle.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradle
```

{% endcode %}
{% endstep %}

{% step %}

### Update `build.gradle`

Add the following to the app-level `build.gradle` to include D1 SDK and its dependencies:

{% code overflow="wrap" lineNumbers="true" %}

```java
repositories {
    flatDir { dir "libs" }
}

dependencies {
    releaseImplementation(name: 'd1-release', ext: 'aar')
    debugImplementation(name: 'd1-debug', ext: 'aar')

    implementation "androidx.annotation:annotation:1.3.0"
    implementation "androidx.appcompat:appcompat:[1.0.0,1.3.1]"
    implementation "com.google.android.gms:play-services-base:18.0.1"
    implementation "net.java.dev.jna:jna:5.17.0@aar"

    // For D1Pay
    implementation "com.google.firebase:firebase-messaging:23.0.2"

    // For D1Authn (3DS)
    // Credentials API. This API requires a mimimum compileSdkVersion of 34.
    implementation "androidx.credentials:credentials:1.2.2"
    // needed for credentials support from play services, for devices running Android 13 and below.
    implementation "androidx.credentials:credentials-play-services-auth:1.2.2"
    implementation "com.google.android.gms:play-services-fido:20.0.1"
    implementation "androidx.biometric:biometric:1.1.0"

    // okhttp is no longer required on SDK v4.2.0 and later
    // implementation "com.squareup.okhttp3:logging-interceptor:4.9.1"
}
```

{% endcode %}
{% endstep %}

{% step %}

### Sync the project

In Android Studio, run **File > Sync Project with Gradle Files**.

After the sync completes, you can call the SDK APIs.
{% endstep %}

{% step %}

### Attaching Javadocs in Android Studio

* Add SDK as gradle dependency to application `releaseImplementation(name: 'd1-release', ext: 'aar')`.
* Select `Project` view for your project structure.
* Expand `External Libraries`.
* Right click on SDK and choose `Library Properties`
* Click on middle '+' button to specify documentation URL: <https://thalesgroup.github.io/d1sdk-docs/d1-sdk/latest/android/index.html>

Quick documentation lookup in Android Studio:

* Control + Q (Windows/Linux)
* Control + J (Mac)
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
**Support 16 KB page sizes**

Starting Nov 1, 2025, all newly developed apps and updates to existing apps submitted to Google Play that target Android 15+ devices must support 16 KB page sizes. This support is available in D1 SDK 4.1.0 and later.

When generating the APK package to comply with 16 KB page size:

* Upgrade to D1 SDK 4.1.0 or later.
* Upgrade JNA dependency to 5.17.0 or later. For JNA 5.17.0, the Android Gradle Plugin (AGP) required is 8.0.2. If JNA version earlier than 8.0.2 is used, integrators may face compilation issues.
* When the AGP version is 8.5.1 or later, the app is automatically aligned with the 16 KB page sizes. If it is earlier than 8.5.1, the integrator needs to set the [legacy packaging options](https://developer.android.com/guide/practices/page-sizes#agp_version_85_or_lower) in the `build.gradle` file.
  {% endhint %}


---

# 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:

```
GET https://docs.payments.thalescloud.io/nfc-payment/integrate-d1-sdk/getting-started/configuration/1.-binary-integration/android.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
