Android Quickstart
Install the Android Video SDK and process your first image
This guide walks you through adding the Android Video SDK to your project and processing your first image.
Add the AAR to your project
Create a libs folder inside your app module and copy the .aar file into it:
app/
libs/
pfc_dynamic_v1.0.6-release.aarThen add the dependency in your build.gradle.kts:
android {
// Prevent compression of model files bundled in the AAR
androidResources {
noCompress.addAll(listOf("pnn", "pnne"))
}
}
dependencies {
implementation(fileTree("libs") { include("*.jar", "*.aar") })
}Sync Gradle after saving.
Initialize the processor
DynamicProcessor is the main entry point for all inference. Create it once and reuse it across the app. Call setLicense before init:
import photos.eyeq.dynamic.DynamicProcessor
val processor = DynamicProcessor(context)
processor.setLicense(apiKey = "YOUR_API_KEY", cert = "YOUR_CERTIFICATE")
val daysLeft = processor.init()init() returns the number of days remaining on the license, -1 if expired, or -2 if the key/cert combination is invalid.
init() loads the model and may take several seconds. Always call it on a background thread.
Process an image
Use processImage to run inference and produce a corrected bitmap in one call:
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
val corrected = withContext(Dispatchers.IO) {
processor.processImage(bitmap, strength = 1.0f)
}
imageView.setImageBitmap(corrected)processImage runs inference and an offscreen GL render, returning a new Bitmap at the original resolution. The source bitmap is not recycled.
For interactive preview, use processImagePreview with DynamicView instead — see Using the SDK.
Complete example
The following combines all the steps into a minimal Activity:
import android.graphics.BitmapFactory
import android.os.Bundle
import android.widget.ImageView
import androidx.activity.ComponentActivity
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import photos.eyeq.dynamic.DynamicProcessor
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val imageView = findViewById<ImageView>(R.id.imageView)
val bitmap = BitmapFactory.decodeResource(resources, R.drawable.sample)
imageView.setImageBitmap(bitmap)
val processor = DynamicProcessor(this)
processor.setLicense(apiKey = "YOUR_API_KEY", cert = "YOUR_CERTIFICATE")
lifecycleScope.launch {
val daysLeft = withContext(Dispatchers.IO) {
processor.init()
}
if (daysLeft < 0) return@launch // license error
val corrected = withContext(Dispatchers.IO) {
processor.processImage(bitmap, strength = 1.0f)
}
imageView.setImageBitmap(corrected)
}
}
}VIDEO-SDK Version 1.0.0.23 built from aa5eef97017e23db1d3051b079500606825ef474 on 5-6-2023.
Copyright © 2026 EyeQ Imaging Inc. All rights reserved.