Skip to main content

Get Started Android

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

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

1. Requirements

The Weavr Android SDK helps you to add both Weavr UI components and Biometric Authentication to your app. To ensure optimal performance and compatibility, please follow these guidelines

  • Minimum Android SDK: 24 (Android 7.0 Nougat)
  • Target & Compile SDK: 34
  • Kotlin: 1.8.0 or newer

Important: always consult Weavr's official documentation for the most up-to-date requirements and recommendations regarding Android SDK versions and Kotlin compatibility.

2. Installation

You can install the Weavr Android SDK via 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

In settings.gradle, under the repositories block:

settings.gradle
repositories {
// ... existing repositories ...
maven { url "https://maven.sumsub.com/repository/maven-public/" }
maven {
url "https://gitlab.okaythis.com/api/v4/projects/15/packages/maven"
name "GitLab"
}
maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
}
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
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
}
}
)

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.