"Turn" Android phone client about QR Code Scan source code--Good

Source: Internet
Author: User

Original URL: Https://github.com/SkillCollege/QrCodeScan

Qrcodescan

This is the Android phone client about the QR code scanning source code, the use of efficient Zbar decoding library, and fixed the Chinese garbled.

Incorporates the Zxing code (which uses the camera management feature).

One, the disadvantage of using open source zxing scanning

1, the original code is the horizontal screen mode, although it can be changed to vertical screen, but the scanning interface customization and multi-screen adaptation is not good

2, the effective scanning area is not good control, may be my own technology immature, did not find a good way

3, Zxing is written in Java, the resolution of the two-dimensional code efficiency is not Zbar fast

Ii. disadvantages of using iOS to develop frequently used Zbar scans

1, Zbar is the C implementation of the two-dimensional code parsing, but in the parsing of Chinese will be garbled

2, Zbar of the scanning field of the camera to control the zxing package is not good

Based on the above reasons, the author decided not to combine the two, using zxing to control the camera to obtain the image, using Zbar to parse the scanned data, eventually forming the current project.

Third, the development process

First Peel zxing Camera control Code, get the original scanned data, zxing Viewfindview personal feeling is not very good, simply I took it off,

Directly through the XML file layout, multi-screen adaptation instantly solved. And for the scanning laser line animation effect, the control of the screen is only a slight transformation of the code can be achieved. How to solve the Chinese garbled character of Zbar? After searching the net to find the need to modify the Zbar qrcodetxt.c will be inside the code iso-8859-1 changed to GBK on the

Iv. Methods of Use

1, Eclipse Direct import operation can

2. If it is running in Android studio, it appears

Couldn‘t load libzbar from loader dalvik.system.PathClassLoader findLibrary returned null异常的解决方法是:A. 把so文件放到如下目录(src/main/jniLibs/armeabi/libzbar.so)|src|--main/|----java/|----res/|----jniLibs/|------armeabi|--------libzbar.soB.Rebuild Project注意:如果是想要在自己的项目中直接使用项目提供的ZbarManager源码。需要保持包名一致(com.zbar.lib)

Thanks to @houny for running exception resolution under Android Studio.

"Turn" Android phone client about QR Code Scan source code--Good

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.