chentao0707/QrCodeScan
FreeAndroid手机客户端二维码扫描
FreeFree tier
About chentao0707/QrCodeScan
QrCodeScan is an Android QR code scanning application that combines the efficient ZBar decoding library (C-based) with ZXing's camera management. It addresses common issues: ZXing's difficulty in customizing the scan area and orientation, and ZBar's Chinese character encoding problem. The project modifies ZBar's qrcodetxt.c to use GBK encoding, fixing Chinese garbled text. It provides a customizable scan interface via XML layout, replacing ZXing's ViewFinderView, supports both portrait and landscape modes, and includes a laser line animation effect. The project is open source under GPL-3.0 license and has 1.2k stars on GitHub.
Key Features
Combines ZBar (fast C-based decoding) and ZXing (camera management)
Fixes ZBar Chinese encoding issue by modifying qrcodetxt.c to use GBK
Customizable scan interface via XML layout (replaces ZXing's ViewFinderView)
Supports portrait and landscape orientation
Laser line animation effect for scan indicator
Provides ZbarManager source code for easy integration
Includes prebuilt native library (libzbar.so) for multiple platforms
Compatible with Eclipse and Android Studio
Pros & Cons
Pros
- Combines advantages of ZXing (camera control) and ZBar (fast decoding)
- Fixes common Chinese encoding issue with ZBar
- Customizable scan interface via XML (easy to adapt to different screen sizes)
- Supports both portrait and landscape orientation
- Free and open source (GPL-3.0)
- Large community (1.2k stars, 430 forks)
Cons
- Requires manual setup for Android Studio (placing .so files in jniLibs)
- Only available for Android platform
- Uses older libraries (ZBar, ZXing 3.1.0); may not be actively maintained (referenced newer versions elsewhere)
- Integration requires keeping specific package name (com.zbar.lib) for ZbarManager
Best For
Android app QR code scanningIntegrating QR code scanning into existing Android apps with custom UIChinese-language QR code scanning (avoids garbled text)Learning how to combine ZXing and ZBar for scanningCustom barcode/QR code reader with flexible layout
FAQ
How to run the project in Eclipse?
Eclipse直接导入运行即可 (Simply import and run directly in Eclipse).
How to run the project in Android Studio?
Place the .so file at src/main/jniLibs/armeabi/libzbar.so, then rebuild the project. Also ensure the package name is com.zbar.lib when using the provided ZbarManager source.
How to fix Chinese garbled text in ZBar?
Modify ZBar's qrcodetxt.c file to change the encoding from ISO-8859-1 to GBK.
What are the benefits of combining ZXing and ZBar?
ZXing provides better camera control and UI customization (especially for multi-screen adaptation), while ZBar offers faster QR code decoding.