Handheld Android 2D Barcode Scanner - How to access the scanner and read data

903 Views Asked by At

I'm busy working with an android device that has a physical barcode scanner built in. I need to access this scanner and scan a PDF417 barcode (like a drivers license).

I found that this to some extent registered as a keyboard, meaning I can get some form of input through the override onKeyDown events. Though, when I try and read this data, is comes back as an encoded string or as a replacement character (special character or the diamond with the question mark).

The code looks something like this:

image

What I need, is for the result to show me what the value is of the barcode I'm scanning.

This is what I'm currently getting:

image2

1

There are 1 best solutions below

0
On

Watch carefully setting up your scanner. The problem is not in the application. In the scanner, you can still add a special of carriage so that the machine will trigger an event onKeyDown