- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
I created an application that needs to scan the bar codes. So i used the intel.xdk.device.scanBarcode() method to realize this function. My problem is that the build of my application doesn't work if i build it with Cordova builder. This is my code:
function BarcodeScanner() {
try {
intel.xdk.device.scanBarcode();
}
catch (err) {
alert(err.message); //This throw "Cannot read property 'scanBarcode' of undefined"
}
}
document.addEventListener("intel.xdk.device.barcode.scan", function (evt) {
intel.xdk.notification.beep(1);
if (evt.success == true) {
artsel = SearchArticoloByBarcode(evt.codedata);
DisplayInfoArt();
ConfArtCheck();
setTimeout(function () { $.ui.scrollToTop("page4", "200") }, 200);
}
else {
alert("Errore lettura");
}
}, false);
The build is successful, but when I run my app I catch an error that says: "Cannot read property 'scanBarcode' of undefined".
If I build the application with legacy builder the app works, but I'd like to use the other builder because the app created is faster and lighter.
The app works also with the Debugger. For now I'm working with an Android Phone (Nexus 5), but the app should run also on iOS and Windows Phone.
Does someone know something about this issue?
Thanks for the help.
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Did you include the Intel Device plugin? You need to enable that in the Plugins settings, under the Projects Tab in the XDK.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Yes, I included that plugin. Futhermore the builder says that the plugin has been installed.
Log File: https://drive.google.com/open?id=0B1GcLTTsayBNTGxfTHREY2xFZjg&authuser=0
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Can you try adding a 3rd party cordova barcode scanner and see if that works?
This one appears to be pretty popular http://plugins.cordova.io/#/package/com.phonegap.plugins.barcodescanner
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hey I have this problem now, can you let me know if you find the solution.
Thank You
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi everybody, I'am sorry for the english, but italian school is not good.
However, I have a similar problem: with ios, android, com.phonegap.plugins.barcodescanner
work fine, but if I compile with legacy for Windows Phone, cordova.plugins is undefined.... and then scan failed. I think, but I'm not sure, plugin not deployed.
Any idea? Thanks a lot.
Bye bye from florence.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
For Loredano. Dear friend, read on google: many people says is better use com.phonegap.plugins.barcodescanner instead of xdk.device.barcode, becasue is not maintened from Intel.
Bye
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi, now I use the cordova plugin for the barcode scanner and I compile in Cordova mode for Androd. With last updates Intel has deprecated the Legacy build, so I decided to re-write the application to compile it in cordova mode. I think this way is better, the app is smoother and ligther.
Bye Bye
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Loredano: but for windows Phone have any idea ?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi every body!! I understand the problem. If you build with legacy (example windows phone) thirdy part plugins CANNOT INDLUDES in the project...... Then I come back to xdk.device.scanbarcode for WP8.
Bye
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Correct. The legacy builds do not make use of the Cordova plugins. The legacy builds will soon be removed and you will not be able to build them anymore.
