Generic barcode scanner programming

A

ac0203

We currently have a Symbol device (MC1000) and have used VS2005 to
write an application which captures data through the built-in
scanner. I have used the SDK from Symbol to get the controls in .NET
and this is fine.

This is fine so long as we stay with Symbol devices. What happens if
we install onto a different device (not Symbol). I presume that the
Symbol libraries will not work on other devices and we would have to
change our app to use the library from the new device.

It would be nice to have some generic code that we could use so that
our app can be put onto any device running CE. Has anyone done this?
This would save me a whole load of hassle as it looks like our
customer may have there own devices in some cases and would want our
app to run on them rather than go and buy new devices.

Cheers

AC
 
M

Matt Lacey

We currently have a Symbol device (MC1000) and have used VS2005 to
write an application which captures data through the built-in
scanner. I have used the SDK from Symbol to get the controls in .NET
and this is fine.

This is fine so long as we stay with Symbol devices. What happens if
we install onto a different device (not Symbol). I presume that the
Symbol libraries will not work on other devices and we would have to
change our app to use the library from the new device.

It would be nice to have some generic code that we could use so that
our app can be put onto any device running CE. Has anyone done this?
This would save me a whole load of hassle as it looks like our
customer may have there own devices in some cases and would want our
app to run on them rather than go and buy new devices.

Cheers

AC

The bad news is that you will need different code for each type of
scanner you are using.
This is because different scanners/devices will require different
supporting files (dlls, normally). They will also implement the way
of returning what was scanned (normally barcode contents, but may be
an image). Configuration of the scanners can also vary widely.

In the past I have developed an application that included scanning and
imaging functionality that ran on devices from Symbol, Handheld,
Intermec, Psion Teklogix and NordicID. We did this by putting all the
device specific code in separate classes and then used compiler
directives to include the relevant classes at build time. This did,
obviously, require that we had separate exes for the different
machines.

Most device manufacturers have good developer tools and are keen to
help as any programs you write that will work on their devices can
only lead to the sale of more of their devices.

I known of other people who have created an abstraction layer and then
determined in code which device the code was running on and used the
relevant classes accordingly.

Yes it would be lovely if all scanners worked the same way but this
would cause at least two problems (more may come to me if I think
about it longer.) Firstly, device manufacturers would lose their tie
ins with their customers. Secondly, different scanners work in
different ways and can return different information. A standard
interface to ALL possible events, parameters and return data would be
VERY complicated.
 
N

Neil Cowburn

In this scenario, design patterns are king. In particular, factory patterns.
By defining an common interface, you can create simple wrappers for each of
the scanner SDKs. Then you create a factory method that simply returns a
reference to the common interface. In your app, you call the factory method
to get a reference to the relevant scanner wrapper and then just code
against the interface. Some call this a provider model. Some call it a
plugin model. Which you prefer, it does the job of abstracting the scanner
SDK implementation away from the application allowing your app to use pretty
much SDK you like as long as you provide a wrapper for the SDK which
implements your common interface.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

http://www.opennetcf.com/
 
B

barcodewiz

AC,

One way to do this is to use the "keyboard wedge" software of the PDA
(such as ScanWedge on the Symbol units). Of course, this may not be
the best solution because it requires focus on the app or the text box
you scan into.

Alek Szymanski
http://www.barcodewiz.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top