{"id":29079549,"url":"https://github.com/markusfisch/barcodescannerview","last_synced_at":"2025-06-27T17:08:13.497Z","repository":{"id":139267640,"uuid":"504212969","full_name":"markusfisch/BarcodeScannerView","owner":"markusfisch","description":"A barcode scanner view for Android. Batteries included.","archived":false,"fork":false,"pushed_at":"2025-06-24T20:51:30.000Z","size":114,"stargazers_count":16,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T17:06:52.339Z","etag":null,"topics":["android","android-library","barcode-reader","barcode-scanner","qr-code","qrcode","qrcode-reader","qrcode-scanner"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markusfisch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T15:40:20.000Z","updated_at":"2025-06-24T20:51:36.000Z","dependencies_parsed_at":"2023-06-02T03:45:47.983Z","dependency_job_id":"ef3e9816-a26d-4b79-96c8-f1e836b2c5b7","html_url":"https://github.com/markusfisch/BarcodeScannerView","commit_stats":{"total_commits":65,"total_committers":2,"mean_commits":32.5,"dds":0.01538461538461533,"last_synced_commit":"ff4b686402b1f0fb4791f33d0b3a17ed1c3de8fc"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/markusfisch/BarcodeScannerView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FBarcodeScannerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FBarcodeScannerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FBarcodeScannerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FBarcodeScannerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markusfisch","download_url":"https://codeload.github.com/markusfisch/BarcodeScannerView/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FBarcodeScannerView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262298771,"owners_count":23289603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","barcode-reader","barcode-scanner","qr-code","qrcode","qrcode-reader","qrcode-scanner"],"created_at":"2025-06-27T17:06:31.938Z","updated_at":"2025-06-27T17:08:13.468Z","avatar_url":"https://github.com/markusfisch.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Barcode Scanner View\n\nA barcode scanner view for Android. Batteries included.\nRequires `minSdkVersion` of 9 or higher.\n\nThis is an Open Source alternative for the\n[Google code scanner](https://developers.google.com/ml-kit/code-scanner)\nin Google's ML Kit. If you just need to scan a barcode and do not need to\nembed the scanning view, you should also check out the ML Kit solution.\n\n## How to include\n\n### Gradle\n\nAdd the JitPack repository in your root build.gradle at the end of\nrepositories:\n\n```groovy\nallprojects {\n\trepositories {\n\t\t…\n\t\tmaven { url 'https://jitpack.io' }\n\t}\n}\n```\n\nThen add the dependency in your app/build.gradle:\n\n```groovy\ndependencies {\n\timplementation 'com.github.markusfisch:BarcodeScannerView:1.6.3'\n}\n```\n\n### Manually\n\nAlternatively you may just download the latest `aar` from\n[Releases](https://github.com/markusfisch/BarcodeScannerView/releases)\nand put it into `app/libs` in your app.\n\nIn this case you need to add the dependencies of this library to your\n`app/build.gradle`, too:\n\n```groovy\ndependencies {\n\timplementation fileTree(dir: 'libs', include: '*')\n\timplementation 'com.github.markusfisch:CameraView:…'\n\timplementation 'com.github.markusfisch:zxing-cpp:…'\n\t…\n}\n```\n\nPlease take the version numbers for these two dependencies from\n`barcodescannerview/build.gradle`.\n\n## How to use\n\nAdd it to a layout:\n\n```xml\n\u003cde.markusfisch.android.barcodescannerview.widget.BarcodeScannerView\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/barcode_scanner\"\n\tandroid:layout_width=\"match_parent\"\n\tandroid:layout_height=\"match_parent\"/\u003e\n```\n\nOr create it programmatically:\n\n```java\nimport de.markusfisch.android.barcodescannerview.widget.BarcodeScannerView;\n\nBarcodeScannerView scannerView = new BarcodeScannerView(context);\n```\n\nRun `BarcodeScannerView.openAsync()`/`.close()` in `onResume()`/`onPause()`\nof your activity or fragment:\n\n```java\n\t@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tscannerView.openAsync();\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t\tsuper.onPause();\n\t\tscannerView.close();\n\t}\n```\n\n### Crop window\n\nYou can define a square crop window with `setCropRatio()`:\n\n```java\nscannerView.setCropRatio(0.75f);\n```\n\nThe number is the ratio between the size of the crop square and the\nshorter dimension of the view. For example, `0.75` means 75% of the view\nwidth in portrait orientation.\n\nA crop window can improve the user experience by providing a clear UI\nand it also improves performance because there's less data to process.\n\n### Set barcode formats\n\nBy default only `Format.QR_CODE` is set.\n\nIf you don't want to scan for QR Codes you can do:\n\n```java\nscannerView.formats.clear();\n```\n\nTo scan for `Format.EAN_13` for example:\n\n```java\nscannerView.formats.add(de.markusfisch.android.zxingcpp.ZxingCpp.Format.EAN_13);\n```\n\nThe following formats are supported:\n\n* `AZTEC`\n* `CODABAR`\n* `CODE_39`\n* `CODE_93`\n* `CODE_128`\n* `DATA_BAR`\n* `DATA_BAR_EXPANDED`\n* `DATA_MATRIX`\n* `EAN_8`\n* `EAN_13`\n* `ITF`\n* `MAXICODE`\n* `PDF_417`\n* `QR_CODE`\n* `MICRO_QR_CODE`\n* `UPC_A`\n* `UPC_E`\n\n## Demo\n\nYou can run the enclosed [demo app](app) to see if this widget is what you're\nlooking for.\n\nEither import it into Android Studio or just type `make` to build, install\nand run it on a connected device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusfisch%2Fbarcodescannerview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkusfisch%2Fbarcodescannerview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusfisch%2Fbarcodescannerview/lists"}