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.

KetkiK
  • 40
  • 5
Sridhar
  • 2,228
  • 10
  • 48
  • 79
  • so you want machine to machine communication ? – Ozan Sep 30 '14 at 13:37
  • 1
    yes I want phone to external Scanner communication? – Sridhar Sep 30 '14 at 13:38
  • so does scanner have framework or something for communication with server side ? – Ozan Sep 30 '14 at 13:40
  • @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. – Sridhar Sep 30 '14 at 13:43
  • 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 etc – Ozan Sep 30 '14 at 13:46
  • "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." – 2Dee Sep 30 '14 at 13:46
  • @Sridhar Are you able to create this application which support all Wireless Barcode Scanner. I've implement the same. – Suresh Sharma Jan 20 '16 at 07:32
  • 2
    I hate when people close such valid questions lightly. SO is not about writing code only, but finding solutions too! – Yar Sep 11 '17 at 13:48
  • @Sridhar were you able to implement a common solution? If so can you brief me ? – Satyen Udeshi Oct 17 '17 at 08:59
  • @Sridhar : do you find out any solution for how to connect a barcode scanner with a mobile device using Bluetooth? – Anand Savjani Oct 19 '19 at 15:22
  • Anyone who solved this? – c-an Dec 16 '20 at 17:40

2 Answers2

16

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

Enrico
  • 10,377
  • 8
  • 44
  • 55
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

Kirill Podlivaev
  • 446
  • 7
  • 11