Reading barcodes with android

与世无争的帅哥 提交于 2019-11-29 18:57:31

Android programs can interact with eachother using intents. Intents are a little like remote procedure calls: you ask the other program for a certain action (e.g. scan a barcode) and the other program will perform this task for you. The result is returned when the task is complete.

If the user has installed the ZXing Barcode Scanner, you can just use an intent to scan a barcode. The Barcode Scanner will then start, let the user scan the code and return the result to you.

More information about this scanner can be found on the Google Code page of this project: http://code.google.com/p/zxing/wiki/ScanningViaIntent

I'd look at this open source Android project: http://code.google.com/p/zxing/

For fellow Google search travelers, there is a 2012 post on the android developers blog on how to use intents with the example of barcode scanning :

http://android-developers.blogspot.com/2012/02/share-with-intents.html

As far as I know for decoding barcodes (apart from the algorithm) you need to know the (relative) widths of white and black bars. For that, you would have to rotate the barcode to a horizontal position and then detect the widths.

(Ok, the ZXIng stuff advised by others outperforms this manual hacking)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!