bar code QR code scanning

Has anyone integrate this capability using the mobile device’s capability to populate fields.  We are looking to track materials by scanning their bar and QR codes to find the product in the database.

We have not seen it done, but it completely should be feasible.  The device should be able to make the ID scanned from the QR code available to the browser, and you should be able to inject that value into a field using our Javascript API. 

ah the search continues then for the limitations of SKUID

Chad,

Did you ever figure this out?  We’ll have the same need soon.

Thanks

There is a Java library, called zxing, that was particularly designed for the mobile use-case. I worked with it to develop a web application that will both generate and scan in QR codes and found it easy to work with. There are also complete code samples on the internet for scanning QR codes with the phone’s camera and decoding them with zxing, as is discussed here:

http://stackoverflow.com/questions/23156399/how-to-decode-a-barcode-from-camera-preview-using-zxing-…

From there you could open a URL, passing the QR code’s value in as a query string parameter, for example.

Thanks Eric.  That sounds really sweet. 

Did anyone get this running where you can scan a barcode value into a search field on salesforce1?

Processing a QR code is pretty easy in javascript (or, rather, there are several libraries that can handle this). The main issue is gaining access to your device’s camera to get a live streaming video, which is pretty much the only way to make QR code scanning feasible.

Within the last couple years many browsers have begun adding the ability to access the device’s camera from Javascript via the Media Streaming standard (aka getUserMedia). HTML5 support is slightly older, but didn’t provide a way of accessing the camera from Javascript (it focused on uploading photos/videos to a server). Mobile browsers (ironically) have lagged behind the most in adding streaming support. Android only got this feature with version 5 (Lollipop) and iOS still does not support it. See the following URLs for more details:


The official specification is still in the draft phase, making this technology pretty bleeding edge (although I think it’s probably stable at this point).

I’d expect general support (especially on mobile devices) to firm up in the next year or so, at which point a javascript-based QR code scanner will become much more feasible. I have personally taken an interest in this and actually built out a prototype roughly a year ago, but the mobile browser support was so bad back then that it was pretty much unusable. It’d be fun to revisit, now that Android has added support.

The following contains quote a lot of assumptions and guesses. It’s not be rigorously tested, so definitely take with a grain of salt:

The Salesforce1 app uses a “web view” to render HTML content (I assume), so support for javascript APIs is going to be dependent on whatever browser is running on the system (guessing: they could override default browser capabilities to add or even remove support). On iOS, I’d guess that Salesforce1 is using Safari (even Chrome for iOS uses a Safari WebView, or so I’ve heard). On Android, I’m not sure if Salesforce1 uses the standard Android browser or if it respects a user-overridden default. In either case, it’ll be dependent on the capabilities of the system’s browser. So it’s possible that a QR scanner would work in Salesforce1 on one Android device but not on another, depending on the OS version and the default browser selected by the user.

Just some anecdotal tidbits from me. The only mobile device I’ve successfully done a QR scan from is my Android with the Firefox browser installed on it. I’ve also gotten it to work in Chrome and Firefox on my laptop. (Kinda funny holding the QR code in front of my laptop’s webcam though.

We have an application built for scanning barcodes but they do require a bluetooth barcode reader - it works very well … the code is scanned straight into the search box and the relevant product returned without a problem.

If anyone gets it working with a device camera let me know )