Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.76 KB

android-getting-started.md

File metadata and controls

39 lines (27 loc) · 1.76 KB

Scanly SDK v2.1.0 for Android

Scanly SDK v2.1.0 is distributed as scanly-sdk-2.1.0.aar on the v2.1.0 GitHub Release. Maven Central is not published and not required for v2.1.0; do not use implementation("io.scanly:scanly-sdk:2.1.0").

Install the AAR

  1. Download scanly-sdk-2.1.0.aar from the GitHub Release.
  2. Place it at app/libs/scanly-sdk-2.1.0.aar.
  3. Add the file dependency:
dependencies {
    implementation(files("libs/scanly-sdk-2.1.0.aar"))
}

Verify the AAR against release/stable/v2.1.0/checksums.sha256 or the checksum attached to the GitHub Release before integration.

CameraX quick start

val decoder = ScanlyDecoder()
val session = ScanlyScannerSession(
    decoder,
    ScanlyOptions(formats = setOf(ScanlyBarcodeFormat.QR_CODE), maxResults = 8),
)
session.onResults = { outcome -> outcome.onSuccess(::renderResults) }

val camera = ScanlyCameraXAdapter(context, session)
camera.bind(this) // LifecycleOwner

CameraX uses ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST. The YUV_420_888 Y plane goes directly through JNI and every ImageProxy is closed. Call pause, resume, stop, or close with the host lifecycle.

The host must request camera permission. Torch support delegates to CameraX and can be unavailable for a specific camera. The AAR contains arm64-v8a/libscanly_jni.so and x86_64/libscanly_jni.so; armeabi-v7a is intentionally unsupported.

See the Android example.

Automated unit, lint, AAR, and x86_64 emulator fixture checks are not physical-device qualification. Physical Android validation remains POST_RELEASE_VALIDATION_PENDING under Issue #13.