我需要在安卓和iPhone中使用phonegap扫描条形码。有没有办法做到这一点?
发布于 2012-04-05 02:50:48
This link会将您带到一个页面,您可以在其中了解如何在应用程序中实现PhoneGap条形码扫描器插件
发布于 2010-12-01 09:20:40
Kris Erickson是正确的,Zxing & Phonegap项目已经为您处理了繁重的工作。(我目前的名声不允许我发表评论,但我会这样做的。)
我刚刚做了一个Phonegap/Android应用程序,可以使用插件here扫描二维码。按照说明进行操作,您应该会成功。有可能这个插件是在Kris的回答之后编写的。
Javascript很简单,直接取自https://github.com/phonegap/phonegap-plugins/
var scanBarcode = function() {
window.plugins.barcodeScanner.scan( BarcodeScanner.Type.QR_CODE,function(result) {
alert("We got a barcode: " + result);
}, function(error) {
alert("Scanning failed: " + error);
}, {yesString: "Install"}
);
}
https://stackoverflow.com/questions/3888396
复制相似问题