Android: How to integrate External BarCode Scanner device connected via USB to Android Application [closed]
Asked Answered
M

2

9

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

  • External barcode scanner is connected to the device via USB.

  • I need the event to fetch the data scanned and sent from the scanner.

Mccahill answered 30/9, 2014 at 13:23 Comment(11)
so you want machine to machine communication ?Collocation
yes I want phone to external Scanner communication?Mccahill
so does scanner have framework or something for communication with server side ?Collocation
@ozi 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.Mccahill
in my opinion, every barcode scanner should send its data to remote server (probably they can), then you can get these data from your smart device with use json or etcCollocation
"Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it."Yellow
@Mccahill Are you able to create this application which support all Wireless Barcode Scanner. I've implement the same.Motorcar
I hate when people close such valid questions lightly. SO is not about writing code only, but finding solutions too!Unloose
@Mccahill were you able to implement a common solution? If so can you brief me ?Iconic
@Mccahill : do you find out any solution for how to connect a barcode scanner with a mobile device using Bluetooth?Opium
Anyone who solved this?Colossal
P
17

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

Periosteum answered 13/10, 2014 at 16:29 Comment(1)
Activity gets destroyed when usb is removed. How did you tackled it?Destroyer
L
0

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

Lippi answered 30/9, 2014 at 14:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.