Barcode Scanner - CodeScanner and QRScanner

46 views
Skip to first unread message

kevin....@gmail.com

unread,
Jan 28, 2015, 2:40:44 PM1/28/15
to codenameone...@googlegroups.com
I have begun developing an application that requires scanning multiple types of barcodes.  I have seen other posts about setting the hint for scanAllCodeTypes to true.  However, I can't get the QRScanner to scan a 2D barcode at all.  If I use the CodeScanner class, and call the appropriate methods, I can scan 2D barcodes and QR codes.
Can one class or the other (QRScanner/CodeScanner) be used to scan all codes with one call?
So for CodeScanner, currently I have:
            CodeScanner.getInstance().scanQRCode(new ScanResult() {
to get QR codes, and:
            CodeScanner.getInstance().scanBarCode(new ScanResult() {
to get barcodes.

And for QRScanner, I must do:
            QRScanner.scanQRCode(new ScanResult() {
for QR codes and:
            QRScanner.scanBarCode(new ScanResult() {
for barcodes.

What do I do to make pushing one button have the ability to scan any type of code?
And is there a way to simulate barcode functionality in the simulator so I don't have to keep sending builds to the server?

Thanks.

Shai Almog

unread,
Jan 29, 2015, 1:51:12 AM1/29/15
to codenameone...@googlegroups.com, kevin....@gmail.com
Currently that's not something we support since the more codes you try and scan the scanning becomes slower and less reliable.
You can use something like the zbar package in the cn1libs http://www.codenameone.com/cn1libs.html or the Zxing demo from the demos section to create something native for the various platforms that allows that.
Reply all
Reply to author
Forward
0 new messages