What type of barcode scanner do I need to access scanner output in Java app?

0

For my project I need to scan barcodes and save them in a database.

I thought about doing this by running a Java app in the background that listens to the port used by the scanner and saves the output of the scanner to the database.

My resources are very limited and I would like to know if I need a special type of scanner for this task. This is the cheapest scanner I found in ebay. Is it valid for this task? Otherwise, what type of scanner should I look for?

Please guide me

sala_7

Posted 2010-09-23T01:00:00.670

Reputation: 11

Answers

2

Most barcode scanners meant to be used with PC's will plug in and act like keyboards. They provide the scanned information as if it had been typed at a keyboard by a user.

So, chances are there's no special "port used by the scanner" and it won't make a difference for this purpose what scanner you choose - you can write a simple app that accepts input from the user and stores it in the database.

You'll want to make sure that the barcode scanner can read the barcodes you're working with, and make sure that the distance from the barcode and scanning speed are appropriate for your application.

gbroiles

Posted 2010-09-23T01:00:00.670

Reputation: 3 938

The problem with that is that I'll need to have focus on an input text field while scanning, which is what I'm trying to avoid. That's why my idea was to have an app running in the background that scans the port used by the scanner to get those numbers and save them in the db. It can't be done? – sala_7 – 2010-09-24T12:39:08.060

I see. Perhaps others can suggest a barcode scanner that doesn't emulate a keyboard. The scanners I'm familiar with don't have a special "port" for you to listen to - I don't know enough about the guts of USB HID handling to address the feasibility of distinguishing "keystrokes" from a scanner versus "keystrokes" from a keyboard. – gbroiles – 2010-09-25T09:13:45.520