My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for

Question or Comment?

Please post to the discussion group at http://groups.google.com/group/zxing .

ScanningFromWebPages  
Using Barcode Scanner on Android to scan from a web page
Featured
Updated Dec 17, 2011 by srowen

Using Barcode Scanner on Android to scan from a web page

As of Barcode Scanner 3.3, on Android, you can invoke Barcode Scanner from a web page and have the result returned to your site via a callback URL. Simply link to a URL like this:

http://zxing.appspot.com/scan?ret=http://foo.com/products/{CODE}/description&SCAN_FORMATS=UPC_A,EAN_13

(See alternate URL below.)

Really, the parameter's value should be properly URL-escaped.

The "ret" parameter specifies the URL to call back with the scan result. {CODE} may appear anywhere and will be replaced with the scanned barcode contents. "SCAN_FORMATS" may be optionally used to supply a comma-separated list of format names.

iPhone

Note that this functionality will be available on the iPhone app "Barcodes" from about January 2012. iOS works differently, and so the URL pattern must instead begin with zxing://scan/. (The trailing slash is needed.) So for example:

zxing://scan/?ret=http://foo.com/products/{CODE}/description&SCAN_FORMATS=UPC_A,EAN_13

Note that this syntax also works on Barcode Scanner 3.8 or later.

Custom search URL

Users can specify a custom search URL to invoke when a barcode is scanned. When set under Settings, a Custom Search button will appear. The search URL can contain two placeholders: %s for the barcode content, and %f for the format. For example, http://example.org/?q=%s&f=%f might invoke, on a scan, a URL like http://example.org/?q=10359050900&f=EAN_13

Powered by Google Project Hosting