Introduction
The Huawei Scan Kit offers versatile scanning, decoding, and generation capacities for bar code and QR code, enabling developers to quickly create the scans for QR code in apps.
Huawei can automatically detect and amplify long-distance or smaller scan codes via its long-range accumulation in the computer vision sector and automate the recognition of normal, complex barcode (example: reflection) scanning (such as dark light, smudge, blur and cylinder) scanning services. Scan Kit improves the performance rate and user experience of QR scanning code.
Zxing is a common third-party open-source SDK, it allows an Android device with imaging hardware (a built-in camera) to scan barcodes or 2-D graphical barcodes and retrieve the data encoded. It only carries out simple QR-code scanning operations and does not support complex scanning conditions, including high light, bend and deformation. However, the optimization effect is still not ideal, and many people will spend a lot of time on the optimization.
Let us now evaluate the Zxing and the Huawei HMS scan kit capabilities:
Note
- In this article, I have scanned the code for 5 times and taken the best time captured.
- Results may vary from device to device. I have used Huawei Y7p device for scanning, maintained similar condition for both HMS scan and Zxing.
Normal Scanning

When simple QR code is scanned from normal distance (around half feet), we have captured the time for decoding the code .
Huawei Scan kit took 0.68 seconds.
Zxing scanner took 1.38 seconds.


Result : HMS Scan kit wins
Scanning QR code at an angle
Let us scan the QR code at an angle more than 45 degrees from line of sight.
Huawei Scan kit took 0.657 seconds.
Zxing scanner took 1.27 seconds.


However, when we tried to capture at an angle more than 60 degrees, Zxing was not able to scan the code.
Result: HMS Scan kit wins
Scanning Damaged and Transformed Code
In some scenarios, code scanning can be classified into reflection, dark light, smudge, blur, and cylinder scanning.

Result : In most of the transformed / damaged codes, HMS scanner was able to detect code in lesser time. HMS Scan kit wins.
Scanning Complex Code:
Complex QR or bar code is too dense to decode. Let us see effectiveness of both the scanners.

Huawei scanner took 2.214 seconds when scanned from ideal distance (1.5 feet). However, if QR code is scanned from close distance it took 10.237 seconds. When QR code is scanned from distance more that 3 to 4 feet, it took 23.105 seconds.
ZXING scan took 19.10 seconds when scanned from ideal distance (1.5 feet). When scanned from too close or away from QR code, it was not able to able to scan it.
Result: HMS Scan kit wins.
Scanning code from long distance
Since Zxing does not have an automatic zoom-in optimisation, it is difficult to recognize code when the code is less than 20% of the frame.
The HMS Scan Kit has a pre-detection feature that can automatically amplify a long distance QR code even if the QR code cannot be detected by naked eyes.
HMS scan took 1.391 sec to detect when QR code is more 8 feet away.
Zxing failed to detect the code.


Result: HMS Scan kit wins
Implementation of HMS scan kit:
Prerequisite
- Java JDK 1.8 or higher is recommended.
- Android Studio is recommended.
- Before developing an app, you will need to register as a HUAWEI developer. Refer to Register a HUAWEI ID.
- Integrating app gallery connect SDK. Refer to AppGallery Connect Service Getting Started.
Development
- Add the HMS scan kit dependencies in module-level build.gradle
2. To launch HMS default scanner
3. Getting the scan result
Reference: