Skip to main content

A. Installation & Dependencies

This guide walks you through how to install the Entrupy Android SDK and its dependencies into your Android project, as well as the minimum supported Android versions and how to import and initialize the SDK.

1. Supported Android Versions​

The Entrupy Android SDK supports:

  • Minimum SDK version: API 24 (Android 7.0 Nougat)
  • Target SDK version: API 35 (Android 15)
  • Java Version: 11

Ensure your project's build.gradle file is configured to use a minimum SDK of at least 24:

android {
compileSdk = 35

defaultConfig {
minSdk = 24
targetSdk = 35
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

2. Installation​

The Entrupy Android SDK is distributed via GitHub Packages as a Maven repository. This method automatically handles all transitive dependencies.

SDK Repository

The SDK is available at github.com/entrupy/entrupy-sdk-android. This repository contains the SDK package distributed via GitHub Packages for Maven-like integration.

Sample Project

For a complete working example, see github.com/entrupy/entrupy-sdk-sampleproject-android. To see only the changes required for SDK integration, navigate to the "Entrupy SDK Integration" commit in the repository's Git history—this commit isolates the exact modifications needed to integrate the SDK into your own project.

2.1 Configure GitHub Packages Authentication​

The SDK is hosted on GitHub Packages, which requires authentication. You can provide credentials via Gradle properties or environment variables.

Option A: Gradle Properties (Recommended)

Add your GitHub credentials to ~/.gradle/gradle.properties:

gpr.user=YOUR_GITHUB_USERNAME
gpr.token=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN

Option B: Environment Variables

Alternatively, set environment variables:

export GITHUB_USER=YOUR_GITHUB_USERNAME
export GITHUB_TOKEN=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN
note

Your GitHub Personal Access Token needs the read:packages scope. See How to Generate a GitHub Personal Access Token below.

2.2 Add the GitHub Packages Repository​

Configure the Entrupy Maven repository in your settings.gradle.kts:

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()

// Entrupy SDK - GitHub Packages
maven {
url = uri("https://maven.pkg.github.com/entrupy/entrupy-sdk-android")
credentials {
username = providers.gradleProperty("gpr.user").orNull
?: providers.environmentVariable("GITHUB_USER").orNull ?: ""
password = providers.gradleProperty("gpr.token").orNull
?: providers.environmentVariable("GITHUB_TOKEN").orNull ?: ""
}
}
}
}

2.3 Add the SDK Dependency​

Add the SDK dependency in your build.gradle.kts (app-level):

dependencies {
implementation("com.entrupy:sdk:2.7.0")
}

2.4 How to Generate a GitHub Personal Access Token​

  1. Sign in to GitHub
    Go to github.com and log in to your account.

  2. Navigate to Token Settings

    • Click your profile picture in the top-right corner
    • Select Settings
    • Scroll down and click Developer settings in the left sidebar
    • Click Personal access tokens → Tokens (classic)
    • Or go directly to: https://github.com/settings/tokens
  3. Generate a New Token

    • Click Generate new token → Generate new token (classic)
    • You may be prompted to confirm your password
  4. Configure the Token

    • Note: Enter a descriptive name (e.g., "Entrupy SDK Access")
    • Expiration: Choose an expiration period
    • Scopes: Check the read:packages scope (under "write:packages")
  5. Create and Copy the Token

    • Click Generate token at the bottom
    • Important: Copy the token immediately—you won't be able to see it again
    • Store it securely in your ~/.gradle/gradle.properties file or as an environment variable

3. Required Permissions​

Add the following permissions to your AndroidManifest.xml:

<uses-feature android:name="android.hardware.camera.any" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

4. Network Security​

The SDK connects to Entrupy over HTTPS only, with TLS 1.2 or 1.3, whatever your app's network security config allows. Cleartext (http://) URLs and redirects from HTTPS to HTTP fail.

The SDK ships no network security config of its own, so your app's android:networkSecurityConfig applies without a manifest merge conflict or tools:replace. The SDK uses your app's trust anchors: it does not pin certificates or add certificate authorities.

Inspecting SDK traffic in debug builds

To inspect SDK requests through a proxy that installs a user certificate authority (such as Proxyman or Charles), trust user certificates in your debuggable builds. Without this, SDK requests fail with SSLHandshakeException behind the proxy. Android ignores <debug-overrides> in release builds.

<!-- res/xml/network_security_config.xml -->
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
<certificates src="system" />
</trust-anchors>
</debug-overrides>
</network-security-config>
<!-- AndroidManifest.xml -->
<application
android:networkSecurityConfig="@xml/network_security_config"
...>

If your app already has a network security config, add the <debug-overrides> block to it.

note

SDK web pages, such as help and certificates, open only https:// links. A plain http:// link inside these pages does nothing.

5. Importing the SDK​

Once installed, import the SDK's main entry point into your Kotlin or Java code.

Kotlin:​

import com.entrupy.sdk.app.EntrupyApp

Java:​

import com.entrupy.sdk.app.EntrupyApp;

6. Initializing the SDK​

The SDK must be initialized before any other SDK call. The simplest place to do it is your Application class's onCreate() method:

Kotlin:​

import android.app.Application
import com.entrupy.sdk.app.EntrupyApp

class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Initialize SDK - MUST be called before any SDK operations
EntrupyApp.init(this)
}
}

Java:​

import android.app.Application;
import com.entrupy.sdk.app.EntrupyApp;

public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize SDK - MUST be called before any SDK operations
EntrupyApp.init(this);
}
}
Important

Make sure your custom Application class is registered in your AndroidManifest.xml:

<application
android:name=".MyApplication"
...>

Initializing on first use​

You can also call EntrupyApp.init(application) later, right before a user first opens an Entrupy flow (for example, just before generateSDKAuthorizationRequest()). Users who never open Entrupy then run no SDK code at launch.

  • Call it before any other SDK call. Calls after the first one do nothing, so you can call it every time a user opens an Entrupy flow.
  • Without a signed-in user, initialization makes no network call. Once loginUser succeeds, the SDK fetches what the capture flow needs in the background.
  • If Android restores your app's process straight into an SDK screen, that screen initializes the SDK itself. You don't need to handle this case.
  • Keep setting EntrupyApp.sharedInstance().theme in Application.onCreate(). Setting the theme does not initialize the SDK, and a restored SDK screen uses the theme your app sets on startup.

With the SDK installed and initialized, you are ready to proceed with app registration and requesting necessary permissions.

Next Steps​