有个比较易用的Android 二维码扫描的开源库:
https://github.com/bingoogolapple/BGAQRCode-Android
它也是基于谷歌的zxing开源库的:
https://github.com/zxing/zxing
在grandle中添加依赖库:
compile \'pub.devrel:easypermissions:0.1.7\'//用于请求相机权限 compile \'com.google.zxing:core:3.2.1\' //谷歌的zxing库 compile \'cn.bingoogolapple:bga-qrcodecore:1.1.7@aar\'//bingoogolapple的库 compile \'cn.bingoogolapple:bga-zxing:1.1.7@aar\'