Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.

Android

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

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

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:

1

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:

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

Update build.gradle

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

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"
}
3

Sync the project

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

After the sync completes, you can call the SDK APIs.

4

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)

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 in the build.gradle file.

Última actualización

¿Te fue útil?