开发者

QR Code reader for android

开发者 https://www.devze.com 2023-04-06 10:23 出处:网络
i am making a qr code reader, i came across zxing lib. i was able to successfully incorporate it on my project.however,when using the app i noticed that it requires another application (i.e qr droid a

i am making a qr code reader, i came across zxing lib. i was able to successfully incorporate it on my project. however, when using the app i noticed that it requires another application (i.e qr droid app) before i can use it, otherwise the application crashes. is there a way that it won't require another app? or is there other lib that i can use? thanks开发者_运维技巧 in advance.

in my code i just called the intent:

Intent qr = new Intent("com.google.zxing.client.android.SCAN");
       qr.putExtra("SCAN_MODE", "QR_CODE_MODE");
       startActivityForResult(qr, 0);


First, it really requires the Barcode Scanner application. Not sure if that answers your question. Second your app crashes because you are not catching ActivityNotFoundException. In Barcode Scanners open source project ZXing, you will find a module android-integration which has complete correct source code for this integration. And you will find compete source for Barcode Scanner which you could use to build scanning into your own app. Otherwise you really do want to integrate with Barcode Scanner by Intent. It is much easier.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号