In the earlier days the logistics and warehouseing was much simpler than today. Each item was handpicked and moved to another location. People were using standard cashiers or just a pen and a piece of paper to keep the lists of inventories. Those days are just gone!
Today everything needs to be done quickly. Customer places order and items need to be shipped almost immediately. Goods arrive to warehouse and warehouse manager needs to know where to place them. He also needs to add them to his inventory. Barcodes can rapidly speed up the logistics of the company. You simply scan a single code and you will access various information that you need to make the decision.
Until now the developers needed to create separate application for each device. Now, Resco offers classes that create universal interface that can access barcode scanners of various devices. This means that one application will be able to scan barcodes from different devices. We support:
- Symbol - Motorola
- Intermec
- Psion
All you need to do is to download SDK of device manufacturers. You can find them here:
Here is the sample code that will help you to handle the barcode scanning on any type of device:
private TagReader m_tagReader = null;
m_tagReader = BarcodeMgr.CreateInstance();
m_tagReader.TagRead += new EventHandler<TagEventArgs>(m_tagReader_TagRead);
private void m_tagReader_TagRead(object sender, TagEventArgs e)
{
if (this.InvokeRequired)
this.Invoke(new Action(m_tagReader_TagRead), sender, e);
else
HandleBarCode(e.Text);
}
private void HandleBarCode(string code)
{
uiTextBoxProductID.Text = code;
}
How to add another miscellaneous scanning devices
If you need to add another type of device that is not yet supported by our barcode scanning interface, you can simply follow these steps (Please note that just for an example, we demonstrated how to add Opticon device):
- Open the
BarCodeMgr
class.
- Add to the
BarCodeReaderDeviceType enum new
"Opticon" option.
- Add into the
CreateInstance
method new Opticon deviceType. It should look as follows:
public static TagReader CreateInstance()
{
BarCodeReaderDeviceType deviceType = BarCodeReaderDeviceType.None;
if (BarCodeUtil.IsSymbolDevice())
deviceType = BarCodeReaderDeviceType.Symbol;
else if (BarCodeUtil.IsIngenicoDevice())
deviceType = BarCodeReaderDeviceType.Ingenico;
else if (BarCodeUtil.IsPsionDevice())
deviceType = BarCodeReaderDeviceType.Psion;
else if (BarCodeUtil.IsOpticonDevice())
deviceType = BarCodeReaderDeviceType.Opticon;
else
deviceType = BarCodeReaderDeviceType.Intermec;
string className = null;
switch(deviceType)
{
case BarCodeReaderDeviceType.Opticon:
className = "UIOptionView.BarCodeReaderOpticon";
break;
case BarCodeReaderDeviceType.Symbol:
className = "UIOptionView.BarCodeReaderSymbol";
break;
case BarCodeReaderDeviceType.Intermec:
className = "UIOptionView.BarCodeReaderIntermec";
break;
case BarCodeReaderDeviceType.Ingenico:
className = "UIOptionView.BarCodeReaderIngenico";
break;
case BarCodeReaderDeviceType.Psion:
className = "UIOptionView.BarCodeReaderPsion";
break;
default:
case BarCodeReaderDeviceType.None:
break;
}
if (string.IsNullOrEmpty(className))
return null;
#if DEBUG
TagReader reader;
try
{
reader = (TagReader)Activator.CreateInstance(Type.GetType(className));
}
catch
{
reader = new BarCodeReaderDebug();
}
reader.IsEnabled = true;
#else
var reader = (TagReader)Activator.CreateInstance(Type.GetType(className));
reader.IsEnabled = true;
#endif
return reader;
}
- Add into the
BarCodeUtil
class new IsOpticonDevice
method to get whether the device is Opticon.
- Now, you need to create your own
BarCodeReaderOpticon
class. This new class is inherited from the TagReader
object.
- In this class, you need to override the IsEnabled property to get or set whether barcode reading is enabled.
- E.g. check the BarCodeReaderPsion.cs where you can find how to do that.
- Into the event, which fires when the device is reading a barcode, call the
OnTagRead
method.
- E.g. check the BarCodeReaderPsion.cs where you can find how to do that.
Barcode scanner sample will be accessible only for users with active subscription.
Product info: http://www.resco.net/developer/mobileformstoolkit/