To get started, please visit: https://github.com/zxing/zxing/wiki/Getting-Started-Developing
ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.
Supported Formats
1D product | 1D industrial | 2D |
---|---|---|
UPC-A | Code 39 | QR Code |
UPC-E | Code 93 | Data Matrix |
EAN-8 | Code 128 | Aztec (beta) |
EAN-13 | Codabar | PDF 417 (beta) |
ITF | ||
RSS-14 | ||
RSS-Expanded |
首先要取得jar包,开发的时候直接把jar导入,获取jar包有两种方式
1、根据sourcecode自己编译
2、网上下载https://repo1.maven.org/maven2/com/google/zxing/
本文主要是自己编译jar包
下载zxing源码https://github.com/zxing/zxing/releases
解压完结构如下
1、把android文件夹导入eclipse,这个工程就是官网的app例子
有错误,为什么,因为需要依赖zxing的核心代码,也就是jar包,但是我们jar还没有,sourcecode在android-core、core和android-integration三个文件夹里
2、导入android-core、core和android-integration
工程右键 -》Properties -》Java Build Path -》Source -》Link Source
选择三个文件夹到java层,添加到项目中
完成后,有错误,都是基本的错误,fix掉错误,下一步开始导出jar包。
3、导出jar包
到这里就大功告成了,zxing-3.2.0.jar就是我们开发当中要用的东西了。