我是 Phonegap 和 JS 的新手...我用条形码扫描仪尝试了...我通过本教程安装了 Phonegap 和所有内容http://teusink.blogspot.com/2013/07/guide-phonegap-3-android-windows.html http://teusink.blogspot.com/2013/07/guide-phonegap-3-android-windows.html
我从 CMD 安装了 BarcodeScanner 并将项目导出为 android 平台...
将其添加到 Eclipse ...遵循所有教程如何操作,添加所有权限和内容..
当我在 ma samsung tab2 上尝试该应用程序时...该应用程序出现,但是当我单击“扫描”链接时,我收到错误“未捕获的模块 cordova/plugin/BarcodeScanner 在 logcat 中未找到”。
这是电话<a href="#" class="btn large" onclick="scaning();">Scan</a
我在索引 html 头中有这个
<script src="phonegap.js"></script>
<script src="barcodescanner.js"></script>
这是扫描功能
函数扫描(){
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan(
function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
},
function (error) {
alert("Scanning failed: " + error);
}
);};
这是在 config.xml 中
<feature name="BarcodeScanner">
<param name="android-package" value="com.phonegap.plugins.barcodescanner.BarcodeScanner" />
</feature>
我想我检查了整个谷歌的答案...但到目前为止没有任何效果...而且对于phonegap 3.0+版本,几乎没有条形码扫描仪的文档...至少对于初学者来说...
如果你们能帮助我...因为我完全迷路了:S