Skip to main content

Get started Android

1. Prerequisites

To utilise the Weavr Android SDK for Kotlin/Java, you need:

  1. Android Studio
  2. Active UI Key from the Embedder Portal
  3. Weavr Android SDK

Compatibility

  • Minimum Android SDK: 24 (Android 7.0 Nougat)
  • Target & Compile SDK: 35
  • Kotlin: 1.8.0 or newer
VersionRelease dateMin OS version
3.2August 202524+
3.1August 202524+
3.0June 202524+
2.0January 202524+
1.7January 202524+
1.6June 202424+

2. Installation

Install our Android SDK with Gradle.

2.1 Add dependency

Add the Weavr SDK to your project's build.gradle:

build.gradle
implementation 'io.weavr.components:secure-components:<latest_version>'

2.2 Configure repositories

The Weavr Android SDK is published to Maven Central. Ensure your repositories include Maven Central (enabled by default in most Android projects):

settings.gradle
repositories {
google()
mavenCentral()
}
info
  • Dependency Management: Ensures your project can resolve both open source and proprietary libraries.
  • Flexibility: Integrate multiple SDKs, APIs, or services.
  • Security: Stick to secure, well-known repositories to maintain code integrity.

2.3 Add BouncyCastle configuration

In your app module’s build.gradle:

build.gradle (app)
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == "org.bouncycastle") {
details.useTarget("org.bouncycastle:bcprov-jdk15to18:1.68")
}
}
}

Click ‘Sync Now’ in Android Studio to apply.

3. Available environments

The SDK supports multiple environments:

enum class ENV {
PRODUCTION, // Production environment
SANDBOX, // Sandbox/Testing environment
}

4. SDK initialisation

In your Application class or MainActivity:

// Initialize UX Components
UXComponents.initialize(
context = this,
env = ENV.SANDBOX, // or ENV.PRODUCTION
uiKey = "YOUR_UI_KEY"
)

// Initialize Biometric Authentication (only if using PSA features such as
// biometric login, step-up authentication, or enrolment).
UXComponents.psa.initialize(
context = this,
psaENV = PsaENV.SANDBOX, // or PsaENV.PRODUCTION
logger = object : ExceptionLogger {
override fun exception(message: String?, exception: Exception?) {
// Handle exceptions
}
override fun setUserIdentificator(identifier: String?) {
// Set user identifier
}
}
)

Troubleshooting mixed Approov versions

If your build pulls multiple Approov versions transitively, use the following to inspect the dependency graph:

./gradlew app:dependencyInsight --configuration releaseRuntimeClasspath --dependency approov

If multiple versions are present, add Gradle excludes on the dependency that brings the older version. For example:

dependencies {
implementation('io.weavr.components:secure-components:<latest_version>') {
exclude group: 'com.criticalblue', module: 'approovsdk'
}
}

4.1 Build optimisation note

If you’re using R8 full mode in release, you may need to disable it in gradle.properties:

android.enableR8.fullMode=false

This is recommended when integrating the Weavr SDK to ensure all SDK components are properly included in your release builds.

5. Document upload configuration

When using the KYC integration, you can configure the allowed file types for document uploads by adding this to your strings.xml:

<string name="sns_gallery_type">*/*</string>

This setting controls what types of files users can select from their device's gallery during the KYC process. The default value */* allows all file types. The SDK supports PDF preview for devices running Android 5.0 (Lollipop) and above.