Skip to main content

Android Paper Installation

Requirements​

RequirementVersion
Android Min SDK24+ (Android 7.0+)
Android Compile SDK37+
Android Gradle PluginVerified with 9.3.1
Java17+
Kotlin2.1+
Architecturearmeabi-v7a, arm64-v8a
CameraRear camera. The SDK targets 1080p and falls back to the closest lower resolution.

Your app's targetSdk is independent of the compile SDK and does not need to change. If you also use the Activation SDK, see the Android SDK Version Matrix for the versions verified together.

The Paper Receipt SDK is built with Kotlin 2.2. A Kotlin compiler can only read libraries built with a Kotlin version at most one minor version newer than itself, so your app needs Kotlin 2.1 or newer. If you also use the Activation SDK, you need Kotlin 2.2 or newer (2.3.x recommended) — see the Activation prerequisites.

1. Add the Maven Repository​

Ensure mavenCentral() is included in your settings.gradle (or build.gradle) repositories block:

repositories {
// ...
mavenCentral()
}

2. Add Dependencies​

Add the BOM and the modules you need to your app's build.gradle.kts:

build.gradle.kts
dependencies {
implementation(platform("com.microblink.blinkreceipt:blinkreceipt-bom:2.5.0"))

implementation("com.microblink.blinkreceipt:blinkreceipt-recognizer")

// Optional — the ready-made camera screen. See Camera UI Customization.
implementation("com.microblink.blinkreceipt:blinkreceipt-camera-ui")
}

The BOM keeps every Paper Receipt module on one matching version, so you never declare individual module versions. blinkreceipt-recognizer brings in blinkreceipt-core and blinkreceipt-camera, so you don't need to declare them. Add blinkreceipt-camera-ui if you want the ready-made camera screen; leave it out if you build your own UI around RecognizerView (see Android Paper Integration).

Using the Activation SDK too?

The Paper Receipt SDK does not bring the Activation SDK in transitively. Declare both BOMs at the versions from the same row of the Android SDK Version Matrix — Paper Receipt 2.5.0 pairs with Activation 1.2.0.

3. R8 / ProGuard Rules​

No manual rules are needed. Every module ships its own consumer R8/ProGuard rules — including those for Retrofit, OkHttp, and OkIO — and they are applied automatically when you minify, including under R8 full mode. If you previously copied keep rules for these libraries into your app, you can remove them.

4. Add Your License Key​

Add your license key to AndroidManifest.xml, inside the <application> element:

<meta-data
android:name="com.microblink.LicenseKey"
android:value="YOUR_LICENSE_KEY" />

The SDK reads this key when it initializes. Without it, initialization fails with "license key not found in your manifest!". Alternatively, pass the key in code with BlinkReceiptSdk.initialize(context, licenseKey, callback) — see Initialization.

Optional service keys — Product Intelligence, Google Places, Yelp — are covered in AndroidManifest Keys.

5. Permissions and Network​

The SDK's manifests merge android.permission.INTERNET and android.permission.CAMERA into your app. CAMERA is a runtime permission: request it before you open a camera screen, or the camera reports onPermissionDenied() and shows no preview. It is the only permission the SDK needs on every supported API level — from 2.5.0, WRITE_EXTERNAL_STORAGE is not required anywhere, so you can drop it if you added it as a workaround.

If your app restricts outbound traffic with an allow-list, allow api.actualplatform.com. From 2.5.0, a US scan that ends with no identified merchant calls the Trip Resolution API on that host as a last-resort merchant lookup.

6. Initialization​

By default, the SDK initializes automatically via androidx.startup when your app starts, reading the license key from your manifest. No code is needed for standard setups.

To disable auto-initialization and initialize manually, remove the SDK's two initializers in AndroidManifest.xml. Remove both: BarcodeDetectorInitializer depends on ReceiptSdkInitializer, so removing only ReceiptSdkInitializer still initializes the SDK.

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="com.microblink.internal.ReceiptSdkInitializer"
android:value="androidx.startup"
tools:node="remove" />
<meta-data
android:name="com.microblink.internal.BarcodeDetectorInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>

Then initialize from your Application class:

class MyApplication : Application() {
override fun onCreate() {
super.onCreate()

BlinkReceiptSdk.initialize(this, object : InitializeCallback {
override fun onComplete() {
// The SDK is ready.
}

override fun onException(throwable: Throwable) {
// For example, the license key is missing or invalid.
}
})
}
}

initialize(context, callback) reads the license key from the manifest. To supply it in code instead, call initialize(context, licenseKey, callback).

If your app uses a custom WorkManager configuration, see WorkManager Integration for additional setup steps.

7. Processor Architecture​

The SDK ships with armeabi-v7a and arm64-v8a native binaries. To minimize APK size, distribute your app via Android App Bundle, which lets Google Play serve the correct ABI per device.

If you need APK splits instead, configure them in build.gradle.kts:

build.gradle.kts
android {
splits {
abi {
isEnable = true
reset()
include("armeabi-v7a", "arm64-v8a")
isUniversalApk = true
}
}
}