android-barcode-scanner-scaffold

Builds QR and barcode scanning into Android apps using CameraX, ML Kit, and the Google code scanner.

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/nolte/claude-android-engineering --skill android-barcode-scanner-scaffold-nolte
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-barcode-scanner-scaffold
Source: https://github.com/nolte/claude-android-engineering/tree/main/skills/android-barcode-scanner-scaffold
Command: npx skills add https://github.com/nolte/claude-android-engineering --skill android-barcode-scanner-scaffold-nolte

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding barcode or QR scanning to an Android app involves decisions that fail silently: choosing between the permission-free Google code scanner and an in-app CameraX pipeline, computing a capture resolution that can actually decode small codes, and treating every decoded payload as untrusted input. This Skill operationalizes the spec/android/barcode-scanning/ rules so the scanner decodes reliably and never auto-acts on a scanned value. ## Core Features & Use Cases - Access-path decision: Chooses between the Play-services code scanner (no camera permission), in-app CameraX plus ML Kit, or a GMS-free ZXing path, with the permission and Data Safety consequences recorded. - Decodable camera pipeline: Computes the ResolutionSelector from the 2-pixels-per-module budget, configures KEEP_ONLY_LATEST backpressure, ImageProxy closing, rotation handling, and ML Kit zoom suggestions. - Payload trust boundary: Validates decoded URLs, tel:, WIFI:, and other payload classes behind a show-then-confirm surface, and generates QR codes with correct quiet zones and error correction. - Use Case: A user asks to add a QR scanner screen to an existing Kotlin/Compose app; the Skill walks the access-path gate, wires dependencies through the version catalog, builds the pipeline and confirmation surface, and finishes with a green ./gradlew build. ## Quick Start Add a QR code scanner screen to my Android app that validates scanned URLs before opening them.

Frequently Asked Questions about android-barcode-scanner-scaffold

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add QR code scanning to an Android app?

Use the Google code scanner (play-services-code-scanner) for one-shot scans without requesting the camera permission, or build an in-app CameraX plus ML Kit pipeline when you need a custom viewfinder, continuous scanning, or overlays. Restrict formats to what the feature consumes and handle the module-not-downloaded state.

Google code scanner vs CameraX with ML Kit for barcode scanning?

The Google code scanner needs no camera permission because scanning happens inside Play services, but offers no UI control or continuous scanning. CameraX plus ML Kit gives full control of the surface at the cost of a permission prompt, a privacy indicator, and a pipeline to maintain.

Why does my Android barcode scanner never detect codes?

The most common cause is CameraX's default ImageAnalysis resolution, which is bounded at VGA (640x480) and falls below the 2-pixels-per-module budget for small or distant codes. Compute an explicit ResolutionSelector from the symbology, code size, and scanning distance instead of accepting the default.

Does ML Kit barcode scanning work without Google Play services?

The bundled ML Kit model (com.google.mlkit:barcode-scanning) works on-device without Play services but adds about 2.4 MB to the APK. For genuinely GMS-free devices, use maintained com.google.zxing:core driven from your own CameraX pipeline rather than the stale zxing-android-embedded library.

How should an app handle scanned QR code URLs safely?

Treat every decoded payload as untrusted input: show the destination and require explicit user action before anything happens, allowlist URL schemes, exact-match hosts, and never pass scanned strings to Intent.parseUri, WebView loadUrl, SQL, or auto-dialing intents. Use ACTION_DIAL rather than ACTION_CALL for tel: payloads.

Can ML Kit scan QR codes with UTF-8 or non-Latin text?

No. Correct UTF-8 encoding requires an ECI designator, and ML Kit does not recognize ECI-mode QR codes at all. When generating codes, restrict payloads to characters that survive the default interpretation and record the restriction explicitly.