[Huawei Developers] Mike-mei:
Question 1: I wanna know the privacy policy of Scan Kit and the data it collects. Where can I obtain such information?​

Answer: Scan Kit's privacy policy and collected information are illustrated in its official "SDK Privacy and Security Statement" documents, which are separately specified for Android apps and iOS apps.

For Android apps, click here.

For iOS apps, click here.

Question 2: How to use Scan Kit so that my app can recognize multiple barcodes at the same time? If I adopt the multi-barcode recognition mode for my app, what should I do to make my app recognize specified barcodes? In this mode, can the coordinates of the recognized barcodes be returned by Scan Kit? Also, does this mode support auto zoom for a barcode?​

Answer:

(1) To use Scan Kit for simultaneous multi-barcode recognition:

a. Use the MultiProcessor mode for an Android project.

b. Use the Bitmap mode for an iOS project.

View attachment 5898977

(2) To make an app recognize specified barcodes when the multi-barcode recognition mode is adopted:

You are advised to download the sample code of Scan Kit, debug it, and then modify it.

Specifically speaking, multi-barcode recognition is related to the following classes: MainActivity, CommonActivity, ScanResultView, CameraOperation, and CommonHandler. Modify them as follows:

Call cameraOperation.stopPreview(); to stop barcode scanning as soon as a barcode is successfully recognized.

Add the code for obtaining the coordinates of the screen position of a user's touch to CommonActivity.

Check whether the obtained coordinates are within the range defined by the coordinates of the HmsScan object returned by Scan Kit upon barcode recognition success. If so, the barcode scanning UI will be directed to your custom UI, and the HmsScan object will be passed to the custom UI.

You can submit a ticket online for more support, if the answer above does not resolve your question.

(3) Whether the coordinates of the recognized barcodes can be returned by Scan Kit or not:

Yes. The barcode scanning result is obtained via a barcode scanning request, and the result is in the HmsScan structure. You can call HmsScan.getBorderRect to obtain the coordinates of the recognized barcodes.

(4) Whether the multi-barcode recognition mode supports auto zoom for a barcode or not:

No. The multi-barcode recognition mode does not provide this function. This is to avoid the recognition effect of other barcodes being compromised. If you still want your app to provide the zoom-in/out function, you can implement it by using a button or via user touch.

Question 3: Does Scan Kit support auto zoom-in for barcodes? If yes, does the kit allow auto zoom-in to be canceled?​

Answer: Scan Kit supports auto zoom-in, which is embedded in its Default View mode and Customized View mode. In either mode, auto zoom-in can be triggered when specific conditions are met, with zero additional configuration needed.

In Bitmap mode, when recognizing a barcode, Scan Kit would return a command for zoom ratio adjustment to your app. To know how, refer to step 4 in the Scanning Barcodes Using the Camera.

If you do not need the auto zoom-in function, you can select the MultiProcessor mode. It does not provide this function to prevent the recognition effect of other barcodes from being compromised.

Question 4: Does Scan Kit require any subscription fee or copyright authorization?​

Answer: No and no. Scan Kit is free to use.

Question 5. How to implement continuous scanning with Scan Kit?​

Answer:

Call Mode​

Whether Support Continuous Scanning​

How to Implement Continuous Scanning​

Example​

Default View mode	No	/	/
Customized View	Yes	Call setContinuouslyScan. When the value is true (default value), scanning results will be returned without interruption.

When the value is false, scanning results will only be returned one by one, and the same barcode will be returned only once.	remoteView = new RemoteView.Builder().setContext(this).

setContinuouslyScan(true).build();
Bitmap mode	Yes	Do not close the camera during barcode scanning to obtain frames one by one. Then, send a barcode scanning request to Scan Kit. You can determine how the request is sent.	/
MultiProcessor mode	Yes

As the above table shows, Customized View supports continuous barcode scanning. Specifically speaking, you need to set setContinuouslyScan (true) during initialization of RemoteView. For details, see the API Reference for RemoteView.Builder.

Note that the sample code has the logic to close the scanning UI once a barcode is successfully recognized. Therefore, if you use the sample code to test the continuous scanning function, remember to disable this logic in the success callback of RemoteView, to prevent the scanning process from being interrupted.

Question 6: How to customize the barcode scanning UI?​

Answer: Barcode scanning UI customization is not supported by Default View but is supported by the Customized View, Bitmap, and MultiProcessor modes.

To know how to customize the UI, refer to the ScanResultView class and activity_defined.xml or activity_common.xml in the sample code of Scan Kit. You can make adjustments to the UI as required.

activity_defined.xml describes how to customize the UI in Customized View mode, and activity_common.xml tells how to customize the UI in Bitmap or MultiProcessor mode.

Question 7: How to obtain the following data of a successfully recognized barcode: barcode format, as well as the barcode image, barcode coordinates, and barcode corner point information?​

Answer: The prerequisite for obtaining barcode information is that the corresponding barcode is recognized. Scan Kit returns all the information about the recognized barcode in an HmsScan object via the listener for the barcode scanning result callback.

The information covers the barcode coordinates in the input image, original barcode data, barcode format, structured data, zoom ratio, and more.

For details, see Parsing Barcodes and HmsScan.

Question 8: How to make Scan Kit automatically change the language of my app? What countries/regions are supported by the kit?​

Answer: Scan Kit automatically changes the language for your app according to the system language settings, which does not require additional configuration.

Countries/Regions supported by the kit are displayed here. Their languages are also supported by the kit. The languages of countries/regions not listed in the link above means the languages are not yet supported by the kit.

Question 9: Does Scan Kit require the storage read permission when it needs to recognize a barcode in an image from the phone album? I found that in the Default View mode of Scan Kit, if this permission is not granted to the kit, it will fail to access an image from the phone album. Will this issue be resolved?​

Answer: In SDK versions later than Scan SDK 2.10.0.301, the Default View mode allows the storage (media and files) read permission and camera permission to be acquired separately. Click here to learn how.

Get more information at:

HUAWEI Developer Forum

Home page of HMS Core Scan Kit

Development guide for HMS Core Scan Kit