journeyapps/zxing-android-embedded
Barcode scanner library for Android, based on the ZXing decoder
Healthy across all four use cases
weakest axisPermissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓21+ active contributors
- ✓Apache-2.0 licensed
- ✓CI configured
Show all 6 evidence items →Show less
- ✓Tests present
- ⚠Stale — last commit 2y ago
- ⚠Concentrated ownership — top contributor handles 70% of recent commits
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/journeyapps/zxing-android-embedded)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/journeyapps/zxing-android-embedded on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: journeyapps/zxing-android-embedded
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/journeyapps/zxing-android-embedded shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across all four use cases
- 21+ active contributors
- Apache-2.0 licensed
- CI configured
- Tests present
- ⚠ Stale — last commit 2y ago
- ⚠ Concentrated ownership — top contributor handles 70% of recent commits
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live journeyapps/zxing-android-embedded
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/journeyapps/zxing-android-embedded.
What it runs against: a local clone of journeyapps/zxing-android-embedded — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in journeyapps/zxing-android-embedded | Confirms the artifact applies here, not a fork |
| 2 | License is still Apache-2.0 | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 672 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of journeyapps/zxing-android-embedded. If you don't
# have one yet, run these first:
#
# git clone https://github.com/journeyapps/zxing-android-embedded.git
# cd zxing-android-embedded
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of journeyapps/zxing-android-embedded and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "journeyapps/zxing-android-embedded(\\.git)?\\b" \\
&& ok "origin remote is journeyapps/zxing-android-embedded" \\
|| miss "origin remote is not journeyapps/zxing-android-embedded (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
&& ok "license is Apache-2.0" \\
|| miss "license drift — was Apache-2.0 at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "zxing-android-embedded/build.gradle" \\
&& ok "zxing-android-embedded/build.gradle" \\
|| miss "missing critical file: zxing-android-embedded/build.gradle"
test -f "build.gradle" \\
&& ok "build.gradle" \\
|| miss "missing critical file: build.gradle"
test -f "zxing-android-embedded/AndroidManifest.xml" \\
&& ok "zxing-android-embedded/AndroidManifest.xml" \\
|| miss "missing critical file: zxing-android-embedded/AndroidManifest.xml"
test -f "README.md" \\
&& ok "README.md" \\
|| miss "missing critical file: README.md"
test -f "EMBEDDING.md" \\
&& ok "EMBEDDING.md" \\
|| miss "missing critical file: EMBEDDING.md"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 672 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~642d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/journeyapps/zxing-android-embedded"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
A lightweight Android barcode scanner library that wraps the ZXing decoder to enable QR code and 1D barcode scanning. It provides two integration patterns: Intent-based (minimal code required) and Activity-embedded (full UI/UX control), with background thread camera management for fast startup. Single-module structure: core library code (not shown in file list but referenced), sample app in sample/ directory with 7 concrete activity examples (MainActivity, ContinuousCaptureActivity, CustomScannerActivity, etc.), and gradle-based build with ProGuard rules for release builds.
👥Who it's for
Android app developers who need to add barcode scanning without reimplementing the entire ZXing decoder pipeline. Common use cases: logistics apps, POS systems, ticketing apps, and inventory management systems.
🌱Maturity & risk
Production-ready. Currently at version 4.3.0 with recent CI setup (build.yml workflow present), clear semantic versioning, and comprehensive sample applications. The library has stabilized around SDK 24+ support with documented fallback options for older SDKs.
Low risk for typical use cases, but has constraints: requires ZXing:core:3.4.1 which mandates SDK 24+ by default (though SDK 19+ supported with desugaring/multiDex), single library maintainer (journeyapps org), and camera permission complexity on modern Android. No visible CI/CD issues or recent breaking changes documented.
Active areas of work
Library is in maintenance mode at v4.3.0. The build.yml workflow suggests active CI, but primary focus appears to be stability rather than feature development. Sample activities demonstrate various scanning patterns (landscape, continuous, tabbed, toolbar integration).
🚀Get running
git clone https://github.com/journeyapps/zxing-android-embedded.git
cd zxing-android-embedded
./gradlew build
./gradlew installDebugSample
Daily commands:
./gradlew build # Build library and sample
./gradlew installDebugSample # Install sample to connected device
adb shell am start -n example.zxing/.MainActivity # Launch sample app
🗺️Map of the codebase
zxing-android-embedded/build.gradle— Defines the core library module configuration, dependencies on ZXing core (3.4.1), and Android SDK target—critical for understanding build output and compatibility.build.gradle— Root build configuration declaring project version (4.3.0), group (com.journeyapps), and shared Android SDK targets (API 30)—essential for all subproject builds.zxing-android-embedded/AndroidManifest.xml— Library manifest declaring permissions, activities, and metadata for the embedded scanner—required to understand the library's runtime contract.README.md— Primary documentation covering intent-based usage, embedded Activity patterns, camera threading, and SDK version requirements—guides all integration patterns.EMBEDDING.md— Advanced embedding guide for customizing scanner UI and logic when not using Intent-based approach—reference for non-trivial integrations.sample/src/main/java/example/zxing/MainActivity.java— Entry point demonstrating all major usage patterns (Intent, continuous, custom scanning)—canonical example for developers integrating the library.
🛠️How to make changes
Add a new Sample Activity demonstrating a custom scanning pattern
- Create new Activity class in sample/src/main/java/example/zxing/ (
sample/src/main/java/example/zxing/YourCustomActivity.java) - Create corresponding layout XML file in sample/src/main/res/layout/ referencing barcode scanner views (
sample/src/main/res/layout/your_custom_layout.xml) - Register the activity in the sample manifest (
sample/src/main/AndroidManifest.xml) - Add activity entry to MainActivity's navigation/menu to make it discoverable (
sample/src/main/java/example/zxing/MainActivity.java)
Add support for a new barcode format or scanning mode
- Update zxing-android-embedded/build.gradle to depend on a newer ZXing core version if needed (
zxing-android-embedded/build.gradle) - Create a custom sample Activity that configures ZXing with your format hints (
sample/src/main/java/example/zxing/CustomFormatActivity.java) - Document the pattern in EMBEDDING.md for users implementing custom logic (
EMBEDDING.md)
Add a new localized translation for scanner UI strings
- Create new locale-specific strings file in zxing-android-embedded/res-orig/values-XX/ (
zxing-android-embedded/res-orig/values-xx/zxing_strings.xml) - Copy structure from existing zxing_strings.xml and translate all string entries (
zxing-android-embedded/res-orig/values-en/zxing_strings.xml) - Update README.md if adding a major language milestone (
README.md)
Upgrade ZXing core dependency or target SDK
- Update ext.zxingCore or ext.androidTargetSdk in root build.gradle (
build.gradle) - Update version number in root build.gradle if it's a library release (
build.gradle) - Document breaking changes or new features in CHANGES.md (
CHANGES.md) - Update README SDK version requirements if applicable (
README.md)
🔧Why these technologies
- ZXing (com.google.zxing:core:3.4.1) — Industry-standard multi-format barcode decoder; enables decoding ~30+ formats (QR, EAN, UPC, Code128, etc.) with proven performance and accuracy.
- Android Camera API (background thread) — Prevents ANR (Application Not Responding) by offloading camera management and frame processing to a dedicated thread; enables fast UI response.
- Android Intent + startActivityForResult — Provides the simplest, zero-configuration integration path for apps requiring barcode scanning without custom UI; leverages Android's standard IPC mechanism.
- Gradle with multi-module structure (library + sample) — Separates reusable scanner library (AAR artifact) from example code; enables clean dependency management and independent versioning.
- ProGuard/R8 obfuscation rules (proguard-android-optimize.txt) — Protects release builds from reverse engineering while maintaining decoder performance; necessary for production library distribution.
⚖️Trade-offs already made
-
Android SDK 24+ by default (despite minSdk 19 in manifest)
- Why: ZXing core 3.4.x uses features unavailable in SDK 19–23; simplifies maintenance and testing.
- Consequence: Apps targeting SDK 19–23 must add custom configuration (documented in README); limits reach to ~1–2% of active devices but reduces complexity for majority of users.
-
Camera management in background thread vs. main thread
- Why: Camera frame capture can block; background thread ensures UI remains responsive and enables fast Activity startup.
- Consequence: Adds threading complexity; requires careful synchronization in custom implementations (see EMBEDDING.md).
-
Embedded Activity pattern (for advanced use) vs. Intent-only approach
- Why: Intent-based covers 80% of use cases simply; embedded approach allows custom UI, continuous scanning, and fine-grained control.
- Consequence: Developers choosing embedded pattern must handle camera lifecycle, preview rendering, and result callbacks manually; increases integration effort but maximizes flexibility.
-
Audio + visual feedback (beep.ogg) included in library
- Why: Provides user confirmation of successful scan without extra developer code; improves UX consistency.
- Consequence: Fixed behavior; customization requires library modification or reflection; adds ~50KB to AAR size.
🚫Non-goals (don't propose these)
- Real-time document scanning or text recognition (OCR)—library decodes barcodes only, not general images.
- Offline barcode generation—library is decode-only; does not generate/create barcodes.
- Manual barcode entry fallback UI—assumes device has camera; does not provide keyboard input mode.
- Background scanning without visible UI—library requires active Activity with camera preview; cannot scan from service/notification.
- Support for iOS or cross-platform frameworks—Android-only library; no React Native, Flutter, or Xamarin wrappers included.
- Barcode validation or lookups (e.g., inventory database queries)—library returns raw barcode text only; host app implements business logic.
🪤Traps & gotchas
- SDK version complexity: Default setup requires SDK 24+, but SDK 19+ support requires Java desugaring + multiDex + explicit coreLibraryDesugaringEnabled flag (easy to miss)
- Camera permissions: Modern Android (API 30+) requires CAMERA permission in AndroidManifest.xml AND runtime permission check at scan start
- ZXing:core versioning: Locked to 3.4.1; downgrading to 3.3.0 for older SDK support breaks newer bytecode features
- ProGuard/R8 rules: proguard-android-optimize.txt must be applied to release builds or barcode detection may fail due to over-optimization
🏗️Architecture
💡Concepts to learn
- Barcode decoding pipeline — Understanding how ZXing converts camera frames to barcode objects (brightness inversion, edge detection, pattern matching) explains why certain barcodes fail to scan and how to optimize lighting
- Camera lifecycle in background threads — This library manages camera I/O on a background thread to unblock the UI thread; misunderstanding this causes ANRs (Application Not Responding) when modifying scanning behavior
- Intent-based inter-process communication (IPC) — The library's simplest integration pattern launches a separate Activity and returns results via Intent; this is a core Android pattern for modular apps without tight coupling
- Java desugaring and multiDex — Required for SDK 19+ support; desugaring backports Java 8+ APIs to older bytecode and multiDex enables exceeding 65k method limit, both critical for ZXing:core:3.4.1 compatibility
- ProGuard/R8 bytecode optimization — Release builds require ProGuard rules (proguard-android-optimize.txt) to prevent over-optimization of barcode detection logic; misconfiguration breaks production scanning
- Android Activity lifecycle and configuration changes — Camera scanning must pause during Activity rotation; improper lifecycle management causes camera crashes or resource leaks when screen orientation changes
- Runtime permissions (Android 6.0+) — CAMERA permission must be granted at runtime, not just declared in manifest; the library doesn't handle this, delegating to host app—missing this breaks scanning silently
🔗Related repos
journeyapps/BarcodeEmbedder— Same organization's barcode generation library; commonly paired with this scanner for full encode/decode workflowsgoogle/zxing— Upstream decoder library (zxing:core) that this wrapper depends on; critical for understanding barcode format supportmaterial-components/material-components-android— Recommended for Material Design scanner UI overlays; sample uses AppCompat layouts but Material provides modern design patternsandroidx/androidx— Core AndroidX libraries used for compatibility layer (AppCompat, Camera APIs); understanding androidx.camera is needed for custom camera implementationsmlkit/mlkit— Google's modern alternative using ML Kit Vision; developers evaluating this library should understand ML Kit's barcode detection as a potential replacement
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add AndroidX compatibility testing to build.yml workflow
The repo targets Android SDK 24+ but there's no CI validation that the library works with different AndroidX versions and Android API levels. The build.yml workflow only appears to run basic builds. Adding a matrix strategy to test against multiple Android API levels (24, 28, 30) and validate AndroidX compatibility would catch regressions early and help contributors understand minimum version support.
- [ ] Modify .github/workflows/build.yml to add a matrix strategy for Android API levels 24, 28, and 30
- [ ] Add connected/instrumented tests to validate core scanning functionality across API levels
- [ ] Document the tested API level matrix in README.md under a new 'Testing' or 'Compatibility' section
- [ ] Ensure sample app builds and runs on multiple API levels in the CI pipeline
Add unit tests for camera management and lifecycle handling
The zxing-android-embedded library manages camera in a background thread (mentioned as a feature in README), but there are no visible unit tests validating this critical functionality. Missing tests for camera lifecycle, permission handling, and thread safety increase the risk of regressions when contributors modify camera-related code in zxing-android-embedded/src.
- [ ] Create zxing-android-embedded/src/test/java/com/journeyapps/barcodescanner with unit test classes
- [ ] Add tests for CameraManager lifecycle (initialization, pause, resume, cleanup)
- [ ] Add tests for background thread execution and thread safety of camera operations
- [ ] Add tests for permission request handling and camera availability checks
- [ ] Update build.gradle in zxing-android-embedded to include testImplementation dependencies (JUnit, Mockito)
Create specific migration guide for AndroidX transition in EMBEDDING.md
The EMBEDDING.md file provides integration instructions but lacks specific guidance for developers migrating from older non-AndroidX zxing libraries or dealing with AndroidX compatibility. Given that the repo requires Android SDK 24+ and uses modern Gradle (7.0.3), a detailed migration section would help contributors and users avoid common pitfalls when integrating with legacy projects.
- [ ] Add 'AndroidX Migration' section to EMBEDDING.md with specific gradle dependency examples
- [ ] Document required AndroidX dependencies and their versions (androidx.appcompat, androidx.legacy, etc.)
- [ ] Add troubleshooting subsection for common AndroidX-related build errors and their solutions
- [ ] Include sample configuration snippets showing before/after for gradle.properties (android.useAndroidX=true)
- [ ] Link to this section from README.md in the 'Adding aar dependency' section
🌿Good first issues
- Add unit tests for ContinuousCaptureActivity scanning lifecycle (activity appears in sample but no test coverage visible)
- Document camera lifecycle management in EMBEDDING.md—specifically onPause/onResume behavior when scanner is embedded in Fragment vs Activity
- Create example for continuous barcode result streaming with custom listener pattern (sample shows discrete results but not continuous callback)
⭐Top contributors
Click to expand
Top contributors
- @rkistner — 70 commits
- @hannesa2 — 4 commits
- [@Andre Ippisch](https://github.com/Andre Ippisch) — 4 commits
- @ANEWGALAXI — 3 commits
- @saifkhichi96 — 2 commits
📝Recent commits
Click to expand
Recent commits
d09b7c7— Merge pull request #726 from yuchan2215/patch-1 (rkistner)3a2db7f— Fix Typo (yuchan2215)2a65a6c— Merge pull request #708 from amirrudd/patch-1 (rkistner)3c77f1d— Remove duplicate in ReadMe (amirrudd)b6c6421— Merge pull request #696 from saifkhichi96/patch-1 (rkistner)8173d4a— Added color customization instructions in README (saifkhichi96)8fdbbbe— Support custom colors in BarcodeEncoder.java. (saifkhichi96)2324a54— Update README.md (cahofmeyr)c752130— Merge pull request #673 from juliansteenbakker/make-initializeAttributes-public (rkistner)1c27c8f— imp: make initializeAttributes public (juliansteenbakker)
🔒Security observations
The ZXing Android Embedded library has moderate security concerns, primarily stemming from outdated dependencies and build tools. The most critical issues are the use of ZXing core 3.4.1 (from 2018) and Gradle 7.0.3, both of which are significantly outdated and may contain unpatched vulnerabilities. The target SDK version (30) is also outdated compared to current Android standards (34+). These outdated components represent the largest security risk. The codebase itself follows reasonable Android patterns (no hardcoded secrets detected in file structure), but the dependency landscape requires immediate attention. No obvious injection vulnerabilities, misconfigurations, or exposed credentials were detected in the file structure analysis.
- High · Outdated Gradle Build Tool —
build.gradle - classpath 'com.android.tools.build:gradle:7.0.3'. The project uses Gradle 7.0.3 (from build.gradle), which is significantly outdated. Current Gradle versions are 8.x+. Outdated build tools may contain security vulnerabilities and lack important security patches. Fix: Update to the latest stable Gradle version (8.x or higher). Check Android Gradle Plugin release notes for security updates. - High · Outdated ZXing Core Dependency —
build.gradle - ext.zxingCore = 'com.google.zxing:core:3.4.1'. The project uses ZXing core version 3.4.1, released in 2018. This is significantly outdated and may contain known security vulnerabilities. No newer version appears to be actively maintained, but this should be verified. Fix: Check the ZXing project for security advisories. Consider migrating to an actively maintained barcode scanning library or thoroughly audit the ZXing core library for known CVEs. - Medium · Low Target SDK Version —
build.gradle - ext.androidTargetSdk = 30. The project targets Android SDK 30 (androidTargetSdk = 30), which is outdated. Current Android versions are 14+ (SDK 34+). Lower target SDK versions may miss important security features and privacy protections introduced in newer Android versions. Fix: Update targetSdkVersion to at least 33 or higher (preferably 34+) to comply with modern Android security standards and meet app store requirements. - Medium · Minimum SDK 19 Support —
README.md and implied in build configuration. The README indicates support for SDK 19+ with additional configuration. Android SDK 19 (KitKat, released 2013) is extremely outdated and no longer receives security updates. Supporting such old versions expands the attack surface. Fix: Consider increasing minimum SDK version to at least 21 or higher. Document the security implications clearly if older SDK support must be maintained. - Low · Missing ProGuard Configuration Review —
proguard-android-optimize.txt. While ProGuard rules are present (proguard-android-optimize.txt), there is no visibility into their content from the file structure provided. Incomplete or incorrect ProGuard configuration could expose sensitive code patterns. Fix: Review ProGuard/R8 rules to ensure sensitive code is properly obfuscated. Enable advanced obfuscation and optimization settings where appropriate. - Low · Gradle Wrapper Security —
gradle/wrapper/gradle-wrapper.jar. The project uses Gradle wrapper (gradlew, gradle-wrapper.jar). While this is standard practice, the JAR file should be verified to ensure it hasn't been tampered with. Fix: Verify the Gradle wrapper JAR integrity using known checksums. Consider using gradle/wrapper/gradle-wrapper.properties validation in CI/CD pipelines.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.