Implementation method of configuring zxing for code scanning function in Android sdutio

GitHub open source project (zxing) demo

The fastest way to call the zxing method

1. Related third party Library

2. Call basic code scanning

3. Get the return value

The specific codes are as follows:

MainActivity.java

Annotation translation of intentegrater related methods

Setcaptureactivity: sets the activity class usage. It can be any activity, but it should be handled with the intention of additional use here.

Setprompt: set a prompt to appear on the capture screen instead of using the default.

Setorientationlocked: by default, the orientation is locked. Set to false to not lock.

Setcameraid: uses the specified camera ID.

Setbeeenabled: set to false to disable the beep of scanning.

Setbarcodeimageenabled: set to true to save the barcode image in the result intent and send its path.

Setdesiredbarcodeformats: set the required barcode format scanning.

Initiatescan: start scanning all known barcode types and default cameras.

SetTimeout: start scanning all known barcode types and default cameras. And start the timer timeout to complete

Createscanintent: creates a scan intent using the specified options.

The above is the implementation method of Android sdutio configuring zxing for code scanning function introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>