我是Phonegap和JS的新手......我用条形码扫描仪试了一下......我用本教程安装了phonegap和所有内容 http://teusink.blogspot.com/2013/07/guide-phonegap-3 -Android-windows.html
我从CMD安装了BarcodeScanner并将项目导出为android平台...将其添加到Eclipse中......按照所有教程的说明如何操作,添加了所有权限和内容..
当我尝试在ma samsung tab2上的应用程序...应用程序出现但当我点击"扫描"链接时,我得到错误未捕获模块cordova /插件/在logcat中找不到BarcodeScanner.
这是电话 <a href="#" class="btn large" onclick="scaning();">Scan</a
我在索引html头中有这个
<script src="phonegap.js"></script>
<script src="barcodescanner.js"></script>
Run Code Online (Sandbox Code Playgroud)
这是scaning功能scaning(){
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);
}
);};
Run Code Online (Sandbox Code Playgroud)
这是在config.xml中
<feature name="BarcodeScanner">
<param name="android-package" value="com.phonegap.plugins.barcodescanner.BarcodeScanner" />
</feature>
Run Code Online (Sandbox Code Playgroud)
我想我检查了整个谷歌的答案......但到目前为止没有任何效果......而且仍然为phonegap 3.0+版本提供条码扫描器几乎没有文件......至少对于初学者来说......
如果你能帮助我们......那我完全迷失了:S