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

1 Answer 1

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.

2
  • 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
    Sep 24, 2010 at 12:39
  • 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
    Sep 25, 2010 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .