Sridhar
Sridhar

Reputation: 2228

Android: How to integrate External BarCode Scanner device connected via USB to Android Application

I am developing POS application for shop. The Shop keeper can use any brand of BarCode Scanner devices. I need to get the details of the scanned item. Is there any library file available for the same.

FYI

Upvotes: 9

Views: 14505

Answers (2)

Enrico
Enrico

Reputation: 10675

i think every single barcode scanner have integration support for android, but what i need is to give common support for all or more external barcode scanners.

It sounds like you are looking for something that you yourself admit doesn't exist. There isn't a common standard that ALL scanners implement for proper Android integration. That said, here's how you can achieve your two goals

Any Brand: Most barcode scanners support HID mode, which is basically just connecting as a keyboard; this is how practically all USB scanners work. Using HID mode the scanner will "type" the barcode wherever the cursor is located, which doesn't give you much control.

End event: Again, most barcode scanners can be configured to append a trailing character. Usually it defaults to a carriage return or tab. In your activity or view you can set an onKeyListener and in that listener you watch for the KEY_DOWN event of your trailing character which indicates the end of a scan.

Using HID and trailing character detection you will be able to support most wired and wireless scanners

Upvotes: 17

Kirill Podlivaev
Kirill Podlivaev

Reputation: 466

One simple way is to use an intermediate Linux machine, that configured with Sane. When it will work with local Sane frontend (XSane for example), you can try to connect linux to phone with some Sane frotend apps, that available on the Google Play. The next step is implement your own frontend. Last - porting some functionality

Upvotes: 0

Related Questions