ZXing is an open-source, 1D/2D barcode image processing library implemented in Java. The supported barcode formats include UPC-A, UPC-E, EAN-8, Code 93, Code 128, QR Code, Data Matrix, Aztec, PDF 417, etc. Besides the Java version, developers can leverage other ported projects such as QZXing, zxing-cpp, zxing_cpp.rb, python-zxing and ZXing .NET to quickly make barcode reader or writer software. According to the visualization report of Google trends, QR code seems to be the most popular barcode format since 2009. In this post, I’d like to share how to use ZXing to create QR code writer and reader for both desktop Java applications and Android mobile apps.
QR Code Reader and Scanner App for Android 1.3.4.83 for MAC App Preview 2. Our FREE Kaspersky QR Scanner for Android is a smart QR reader that protects you from rogue QR codes containing dangerous links that can lead you somewhere you don’t want to go and expose you to malware and phishing traps. Top QR-Code Scanner SDK features. The QR-Code Scanner SDK gives you fast and precise QR-Code scanning with lots of room for customization. You can use filters to look for specific codes or a batch mode to capture everything that the camera sees. Or you can combine it with document scanning to extract QR-Codes from documents and keep the scanned.
Getting ZXing Source Code
The ZXing project has moved from Google Code to GitHub. To get the source code, use the following git command line:
Linking ZXing to Projects
There are two ways to link ZXing:
- Build the source code to a jar file, and then import it to Java projects. If you want to use Android Studio instead of Eclipse, please read Time to Migrate Android Projects to Android Studio.
- Directly import the ZXing source code to Java projects. In Eclipse, select Project Properties > Java Build Path > Source > Link Source, and specify the source folder location: <zxing>coresrcmainjava. If the folder location is incorrect, you will see many package errors in the console.
Taking a Glimpse of ZXing Source Code
Before implementing QR code writer and reader, let’s take a look at the basic Java classes in ZXing barcode library.
In Eclipse, search for the text implements Writer.
Here are the 1D/2D barcode writers. All barcode formats are defined in BarcodeFormat.java:
The class MultiFormatWriter has covered all supported barcode writers. Instead of any specific bar code writer, we just need to use MultiFormatWriter with a specified barcode format.
Similarly, we can search for implements Reader:
The MultiFormatReader will also simplify the code work.
QR Code Writer and Reader for Windows, Mac and Linux
Since ZXing is implemented in Java, it is easy to create cross-platform QR writer and reader software for Windows, Mac and Linux. To operate image data in Java, we need to use the class BufferedImage.
Helvetica font free download - Font Viewer, Creepygirl Family TrueType Font, Font List Creator, and many more programs. Download Helvetica Neue font for PC/Mac for free, take a test-drive and see the entire character set. Moreover, you can embed it to your website with @font-face support. Helvetica family download for mac.
Writing QR Code with QRCodeWriter
Reading QR Code with QRCodeReader
We need to use RGBLuminanceSource to wrap RGB data:
QR Code Generator and Reader for Android
Comparing to the Java code of the desktop application, the only difference is the way of operating image bytes on Android. In Android SDK, there is no class named BufferedImage. Instead, we should use Bitmap.
Generating QR Code to ImageView on Android
Reading QR Code from Android Camera Preview
The preview data type of Android camera is NV21. So We need to use PlanarYUVLuminanceSource to wrap it.