HTML [ZXing] 웹페이지에서 Barcode Scanner 사용하기
페이지 정보
본문
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
웹페이지에서 스마트폰의 바코드 스캐너 제어하기
1. 일단 스캐너를 작동시키려면 아래와 같이 링크를 생성합니다.
<a href="http://zxing.appspot.com/scan?ret=http://foo.com/products/{CODE}/description&SCAN_FORMATS=UPC_A,EAN_13">바코드 스캐너 작동하기</a>
2. 바코드 스캐너로 읽은 값을 POST 로 넘기기
... 정리중 ...
관련자료
http://code.google.com/p/zxing/wiki/ScanningFromWebPages
http://groups.google.com/group/zxing
댓글목록
등록된 댓글이 없습니다.