Question

I am adding Code 39 bar code scanning functionality to a C# asp.net web app. This function must work with iphone, ipad, android phone, and android tablet. I need the scanned bar code value to be passed back to my web app.

So far I have been able to make this work on android phone and android tablet using ZXing barcode scanner with this method. Unfortunately the current version of ZXing in the App Store (Version 1.1) is currently not capable of scanning 1D bar code types. Through much of my research I have seen that 1D barcode scanning has been ported to later IOS ZXing versions but I'm not an IOS developer and am unsure how to install or enable it.

I have also explored the possibility of using pic2shop's web solution but this only works with UPC and other commercial codes and the bar code must be Code 39 based on my clients requirements.

I have clients all over the country so I can not physically be on site for each one so I need all of the complexity to be on me in my code not on the end user. I realize that the IOS solution will probably not be the same as the droid but I need it to feel as close as possible for the end user because a few of my clients will be using multiple devices and I need to minimize the confusion.

I realize that I have a tall order with a lot of restrictions but any thoughts would be greatly appreciated.

Was it helpful?

Solution

I ended up using CNS Barcode for IOS devices. CNS is a good solution, it does everything that I need but it is not an ideal solution for two reasons:

  1. It is not free. I have no problem with paying for apps, I think that a developer deserves every penny. In my case though this caused an inconveinence to my clients. The small cost is irrelevant when factoring in the benefit of the new functionality but it's hard to sell a product to a client then tell them to make it work you will need to buy this other product.

  2. CNS does not return the result to the calling window/tab, it opens a new tab. In my case this is a problem because the barcode scanner is being used to scan id badges to clock in or clock out employees and may be done 50 times meaning 50 tabs opened.

I was able to create a solution for number two by creating a local key-value storage instance on the new tab along with a key-value change listener on the old tab:

window.addEventListener("storage", onStorageChanged, false);
function onStorageChanged(e)
{
    if(/*check for appropriate key-value*/)
    {
         window.Close();       
    }
}

Note: This solution may have to be modified to pass the actual barcode result in the local key-value storage instance back to the original tab and use window.Close() to close the new tab if the original tab was not opened via javascript, which is probably more often the case, because window.Close() does not work for windows that were browsed to naturally (not opened with javascript).

Since the number 1 concern is only an inconvenience and the number 2 concern is fixable I will mark this as solved.

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top