{"id":22441345,"url":"https://github.com/hms-core/hms-scan-demo","last_synced_at":"2025-04-06T00:10:27.700Z","repository":{"id":37648379,"uuid":"267992743","full_name":"HMS-Core/hms-scan-demo","owner":"HMS-Core","description":"Sample code for demonstrating Huawei HMS ScanKit capabilities. It illustrates how to help developers quickly build code scanning capabilities.","archived":false,"fork":false,"pushed_at":"2023-08-30T09:07:53.000Z","size":782,"stargazers_count":311,"open_issues_count":64,"forks_count":58,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T23:09:49.754Z","etag":null,"topics":["android","android-library","android-sdk","hms","huawei","java","qrcode","scan","scankit"],"latest_commit_sha":null,"homepage":"https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/scan-introduction-4?ha_source=hms1","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HMS-Core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-05-30T02:11:31.000Z","updated_at":"2025-03-26T08:17:26.000Z","dependencies_parsed_at":"2025-02-06T05:11:38.768Z","dependency_job_id":"89e0427d-71ff-46a8-a881-3392b4d9d3c5","html_url":"https://github.com/HMS-Core/hms-scan-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-scan-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-scan-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-scan-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-scan-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HMS-Core","download_url":"https://codeload.github.com/HMS-Core/hms-scan-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415973,"owners_count":20935387,"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","android-sdk","hms","huawei","java","qrcode","scan","scankit"],"created_at":"2024-12-06T02:14:12.800Z","updated_at":"2025-04-06T00:10:27.677Z","avatar_url":"https://github.com/HMS-Core.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HMS Core Scan Kit Sample Code (Android)\n\nEnglish | [中文](README_ZH.md)\n## Contents\n\n* [Introduction](#Introduction)\n* [Environment Requirements](#Environment-Requirements)\n* [Sample Code](#Sample-Code)\n* [Result](#Result)\n* [License](#License)\n\n\n\n## Introduction\n\nThis sample code shows how to quickly build barcode scanning functions into your app using the capabilities of the [HMS Core Scan Kit](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050041994). Currently, Scan Kit supports the following barcode formats:\n\n- 1D barcode formats: [EAN-8](https://en.wikipedia.org/wiki/EAN-8), [EAN-13](https://en.wikipedia.org/wiki/International_Article_Number), [UPC-A](https://en.wikipedia.org/wiki/Universal_Product_Code), [UPC-E](https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E), [Codabar](https://en.wikipedia.org/wiki/Codabar), [Code 39](https://en.wikipedia.org/wiki/Code_39), [Code 93](https://en.wikipedia.org/wiki/Code_93), [Code 128](https://en.wikipedia.org/wiki/Code_128), and [ITF-14](https://en.wikipedia.org/wiki/ITF-14)\n- 2D barcode formats: [QR Code](https://en.wikipedia.org/wiki/QR_code), [Data Matrix](https://en.wikipedia.org/wiki/Data_Matrix), [PDF417](https://en.wikipedia.org/wiki/PDF417), and [Aztec](https://en.wikipedia.org/wiki/Aztec_Code)\n\n\n\n## Environment Requirements\n\nAndroid Studio 3.6.1 or later and JDK 1.8.211 or later.\n\nA Huawei device that runs EMUI 3.0 or later, compatible with HMS Core (APK) 4.0.0 or a generic device running Android 4.4 or later.\n\n\n\n## Sample Code\n\nBarcode scanning and barcode generating can be achieved in different ways, showcased by the demo.\n\n**Default view**\n\nThe [default view](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-default-view-0000001050043961) mode will start a dedicated `Activity` provided by Scan Kit that will display a predefined UI, control the camera and pass back the scanning result via the `onActivityResult()` of the original activity (`com.example.scankitdemo.MainActivity` in the demo) .\n\n**Customized view**\n\nIn [customized view](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-customized-view-0000001050042012) mode, you can define a custom UI, with the help of a `com.huawei.hms.hmsscankit.RemoteView`, and then obtain the scanning result through an asynchronous callback. As with the *default view* mode, you do not need to worry about developing the scanning process or controlling the camera. See `com.example.scankitdemo.DefinedActivity`.\n\n**Bitmap**\n\nUse this mode when you wish to have full control over the input to the scanning process and the moment when you wish to get the results back. In `com.example.scankitdemo.CommonActivity` , the demo will pass a `Bitmap` to `com.huawei.hms.hmsscankit.ScanUtil.decodeWithBitmap()` ([definition](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/scan-scanutil4-0000001050167699#section14774629143713)).\n\n**Multi-processor**\n\nRecognize multiple barcodes at the same time. When working together with the [HMS ML Kit](https://developer.huawei.com/consumer/en/hms/huawei-mlkit/), Scan Kit can detecting both barcodes and human faces. Frame data is transmitted and decoded through [the multi-processor API](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/scan-analyzer4-0000001050167905). See `com.example.scankitdemo.CommonActivity` and read more about [how it works](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-synchronous-mode-0000001050043967).\n\n**Generating barcodes**\n\nGenerate your own barcodes by calling `com.huawei.hms.hmsscankit.ScanUtil.buildBitmap()` ([definition](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/scan-scanutil4-0000001050167699#section56266161243)) in `com.example.scankitdemo.GenerateCodeActivity`.\n\n\n\n## Result\n\n\u003cimg src=\"Screenshot.jpg\" width=250 title=\"ID Photo DIY\" div align=center border=5\u003e\n\n\n\n## Technical Support\n\nYou can visit the [Reddit community](https://www.reddit.com/r/HuaweiDevelopers/) to obtain the latest information about HMS Core and communicate with other developers.\n\nIf you have any questions about the sample code, try the following:\n- Visit [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes), submit your questions, and tag them with `huawei-mobile-services`. Huawei experts will answer your questions.\n- Visit the HMS Core section in the [HUAWEI Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001?ha_source=hms1) and communicate with other developers.\n\nIf you encounter any issues when using the sample code, submit your [issues](https://github.com/HMS-Core/hms-scan-demo/issues) or submit a [pull request](https://github.com/HMS-Core/hms-scan-demo/pulls).\n\n\n\n##  License\n\nThe sample code is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-scan-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhms-core%2Fhms-scan-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-scan-demo/lists"}