GithubHelp home page GithubHelp logo

iskingtind / hms-scan-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marchlqq/hms-scan-demo

0.0 0.0 0.0 777 KB

Sample code for demonstrating Huawei HMS ScanKit capabilities. It illustrates how to help developers quickly build code scanning capabilities.

Home Page: https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/scan-introduction-4?ha_source=hms1

License: Apache License 2.0

Java 61.63% Kotlin 38.37%

hms-scan-demo's Introduction

HMS Core Scan Kit Sample Code (Android)

English | δΈ­ζ–‡

Contents

Introduction

This sample code shows how to quickly build barcode scanning functions into your app using the capabilities of the HMS Core Scan Kit. Currently, Scan Kit supports the following barcode formats:

Environment Requirements

Android Studio 3.6.1 or later and JDK 1.8.211 or later.

A 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.

Sample Code

Barcode scanning can be achieved in different ways, showcased by the demo.

Default view

The default view 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) .

Customized view

In customized view 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.

Bitmap

Use 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).

Multi-processor

Recognize multiple barcodes at the same time. When working together with the HMS ML Kit, Scan Kit can detecting both barcodes and human faces. Frame data is transmitted and decoded through the multi-processor API. See com.example.scankitdemo.CommonActivity and read more about how it works.

Generating barcodes

Generate your own barcodes by calling com.huawei.hms.hmsscankit.ScanUtil.buildBitmap() (definition) in com.example.scankitdemo.GenerateCodeActivity.

Result

Technical Support

You can visit the Reddit community to obtain the latest information about HMS Core and communicate with other developers.

If you have any questions about the sample code, try the following:

  • Visit Stack Overflow, submit your questions, and tag them with huawei-mobile-services. Huawei experts will answer your questions.
  • Visit the HMS Core section in the HUAWEI Developer Forum and communicate with other developers.

If you encounter any issues when using the sample code, submit your issues or submit a pull request.

License

The sample code is licensed under Apache License 2.0.

hms-scan-demo's People

Contributors

abusuioc avatar bugfactory9527 avatar chenjingming1 avatar ferprieto avatar gwwhuawei avatar hms-mlkit avatar hms-scankit avatar huawei-mobile-services-core avatar luckyduby avatar mike-mei avatar tiantian0303 avatar xuejiao-shi avatar xuxiapu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.