[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4358":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":29,"discoverSource":30},4358,"zxing-android-embedded","journeyapps\u002Fzxing-android-embedded","journeyapps","Barcode scanner library for Android, based on the ZXing decoder","https:\u002F\u002Fjourneyapps.com\u002F",null,"Java",5927,1289,168,111,0,2,40.33,"Apache License 2.0",false,"master",[23,24,25],"android-library","barcode-scanning","zxing-android","2026-06-12 02:01:02","# ZXing Android Embedded\n\nBarcode scanning library for Android, using [ZXing][2] for decoding.\n\nThe project is loosely based on the [ZXing Android Barcode Scanner application][2], but is not affiliated with the official ZXing project.\n\nFeatures:\n\n1. Can be used via Intents (little code required).\n2. Can be embedded in an Activity, for advanced customization of UI and logic.\n3. Scanning can be performed in landscape or portrait mode.\n4. Camera is managed in a background thread, for fast startup time.\n\nA sample application is available in [Releases](https:\u002F\u002Fgithub.com\u002Fjourneyapps\u002Fzxing-android-embedded\u002Freleases).\n\nBy default, Android SDK 24+ is required because of `zxing:core` 3.4.x.\nSDK 19+ is supported with additional configuration, see [Older SDK versions](#older-sdk-versions).\n\n## Adding aar dependency with Gradle\n\nAdd the following to your `build.gradle` file:\n\n```groovy\n\u002F\u002F Config for SDK 24+\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'com.journeyapps:zxing-android-embedded:4.3.0'\n}\n```\n\n## Older SDK versions\n\nBy default, only SDK 24+ will work, even though the library specifies 19 as the minimum version.\n\nFor SDK versions 19+, one of the changes below are required.\nSome older SDK versions below 19 may work, but this is not tested or supported.\n\n### Option 1. Downgrade zxing:core to 3.3.0\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }\n    implementation 'com.google.zxing:core:3.3.0'\n}\n```\n\n### Option 2: Desugaring (Advanced)\n\nThis option does not require changing library versions, but may complicate the build process.\n\nThis requires Android Gradle Plugin version 4.0.0 or later.\n\nSee [Java 8+ API desugaring support](https:\u002F\u002Fdeveloper.android.com\u002Fstudio\u002Fwrite\u002Fjava8-support#library-desugaring).\n\nExample for SDK 21+:\n\n```groovy\nandroid {\n    defaultConfig {\n        minSdkVersion 21\n    }\n\n    compileOptions {\n        \u002F\u002F Flag to enable support for the new language APIs\n        coreLibraryDesugaringEnabled true\n        \u002F\u002F Sets Java compatibility to Java 8\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n}\n\ndependencies {\n    implementation 'com.journeyapps:zxing-android-embedded:4.3.0'\n\n    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'\n}\n```\n\nSDK 19+ additionally requires multiDex. In addition to these gradle config changes, the Application\nclass must also be changed. See for details: [Configure your app for multidex](https:\u002F\u002Fdeveloper.android.com\u002Fstudio\u002Fbuild\u002Fmultidex#mdex-gradle).\n\n```groovy\nandroid {\n    defaultConfig {\n        multiDexEnabled true\n        minSdkVersion 19\n    }\n\n    compileOptions {\n        \u002F\u002F Flag to enable support for the new language APIs\n        coreLibraryDesugaringEnabled true\n        \u002F\u002F Sets Java compatibility to Java 8\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n}\n\ndependencies {\n    implementation 'com.journeyapps:zxing-android-embedded:4.3.0'\n\n    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'\n    implementation \"androidx.multidex:multidex:2.0.1\"\n}\n```\n\n## Hardware Acceleration\n\nHardware acceleration is required since TextureView is used.\n\nMake sure it is enabled in your manifest file:\n\n```xml\n    \u003Capplication android:hardwareAccelerated=\"true\" ... >\n```\n\n## Usage with ScanContract\n\nNote: `startActivityForResult` is deprecated, so this example uses `registerForActivityResult` instead.\nSee for details: https:\u002F\u002Fdeveloper.android.com\u002Ftraining\u002Fbasics\u002Fintents\u002Fresult\n\n`startActivityForResult` can still be used via `IntentIntegrator`, but that is not recommended anymore.\n\n```java\n\u002F\u002F Register the launcher and result handler\nprivate final ActivityResultLauncher\u003CScanOptions> barcodeLauncher = registerForActivityResult(new ScanContract(),\n        result -> {\n            if(result.getContents() == null) {\n                Toast.makeText(MyActivity.this, \"Cancelled\", Toast.LENGTH_LONG).show();\n            } else {\n                Toast.makeText(MyActivity.this, \"Scanned: \" + result.getContents(), Toast.LENGTH_LONG).show();\n            }\n        });\n\n\u002F\u002F Launch\npublic void onButtonClick(View view) {\n    barcodeLauncher.launch(new ScanOptions());\n}\n```\n\nCustomize options:\n```java\nScanOptions options = new ScanOptions();\noptions.setDesiredBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES);\noptions.setPrompt(\"Scan a barcode\");\noptions.setCameraId(0);  \u002F\u002F Use a specific camera of the device\noptions.setBeepEnabled(false);\noptions.setBarcodeImageEnabled(true);\nbarcodeLauncher.launch(options);\n```\n\nSee [BarcodeOptions][5] for more options.\n\n### Generate Barcode example\n\nWhile this is not the primary purpose of this library, it does include basic support for\ngenerating some barcode types:\n\n```java\ntry {\n  BarcodeEncoder barcodeEncoder = new BarcodeEncoder();\n  Bitmap bitmap = barcodeEncoder.encodeBitmap(\"content\", BarcodeFormat.QR_CODE, 400, 400);\n  ImageView imageViewQrCode = (ImageView) findViewById(R.id.qrCode);\n  imageViewQrCode.setImageBitmap(bitmap);\n} catch(Exception e) {\n\n}\n```\n\nTo customize the generated barcode image, use the `setBackgroundColor` and `setForegroundColor` functions of the\n`BarcodeEncoder` class with a [`@ColorInt`](https:\u002F\u002Fdeveloper.android.com\u002Freference\u002Fandroidx\u002Fannotation\u002FColorInt)\nvalue to update the background and foreground colors of the barcode respectively. By default, the barcode has a\nwhite background and black foreground.\n\n\n### Changing the orientation\n\nTo change the orientation, specify the orientation in your `AndroidManifest.xml` and let the `ManifestMerger` to update the Activity's definition.\n\nSample:\n\n```xml\n\u003Cactivity\n\t\tandroid:name=\"com.journeyapps.barcodescanner.CaptureActivity\"\n\t\tandroid:screenOrientation=\"fullSensor\"\n\t\ttools:replace=\"screenOrientation\" \u002F>\n```\n\n```java\nScanOptions options = new ScanOptions();\noptions.setOrientationLocked(false);\nbarcodeLauncher.launch(options);\n```\n\n### Customization and advanced options\n\nSee [EMBEDDING](EMBEDDING.md).\n\nFor more advanced options, look at the [Sample Application](https:\u002F\u002Fgithub.com\u002Fjourneyapps\u002Fzxing-android-embedded\u002Fblob\u002Fmaster\u002Fsample\u002Fsrc\u002Fmain\u002Fjava\u002Fexample\u002Fzxing\u002FMainActivity.java),\nand browse the source code of the library.\n\nThis is considered advanced usage, and is not well-documented or supported.\n\n## Android Permissions\n\nThe camera permission is required for barcode scanning to function. It is automatically included as\npart of the library. On Android 6 it is requested at runtime when the barcode scanner is first opened.\n\nWhen using BarcodeView directly (instead of via IntentIntegrator \u002F CaptureActivity), you have to\nrequest the permission manually before calling `BarcodeView#resume()`, otherwise the camera will\nfail to open.\n\n## Building locally\n\n    .\u002Fgradlew assemble\n\nTo deploy the artifacts the your local Maven repository:\n\n    .\u002Fgradlew publishToMavenLocal\n\nYou can then use your local version by specifying in your `build.gradle` file:\n\n    repositories {\n        mavenLocal()\n    }\n\n## Sponsored by\n\n[JourneyApps][1]\n\n\n## License\n\nLicensed under the [Apache License 2.0][7]\n\n\tCopyright (C) 2012-2022 ZXing authors, Journey Mobile\n\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\n\t    http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n\n\n\n[1]: http:\u002F\u002Fjourneyapps.com\n[2]: https:\u002F\u002Fgithub.com\u002Fzxing\u002Fzxing\u002F\n[5]: zxing-android-embedded\u002Fsrc\u002Fcom\u002Fjourneyapps\u002Fbarcodescanner\u002FScanOptions.java\n[7]: http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n","journeyapps\u002Fzxing-android-embedded 是一个基于 ZXing 解码器的 Android 条形码扫描库。其核心功能包括通过 Intent 调用或嵌入到 Activity 中以实现高级自定义，支持横竖屏扫描模式，并在后台线程管理相机以加快启动速度。该项目使用 Java 语言编写，采用 Apache License 2.0 开源许可协议。适用于需要集成条形码扫描功能的各种 Android 应用场景，如零售、物流、资产管理等，特别是对 UI 和逻辑有定制需求的应用。","2026-06-11 02:59:49","top_language"]