- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I`m testing the barcode Scanner resource from Cordova and it is really ok on the XDK IDE, but it doesn`t work on my android.
I removed the intel.XDK.Devices plugin as told on Cordova BarcodeScanner documentation but it didn`t make any efect.
That is my code, thanks in advice.
<!DOCTYPE html>
<html>
<!--
* Please see the included README.md file for license terms and conditions.
-->
<head>
<title>Blank Cordova Mobile App Project Template (Lite)</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<!-- see http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag -->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="http://debug-software.intel.com/target/target-script-min.js#Rvquow84BZYHUg82EPn3DPC3rar3TCzZM_6NQXS5m04"></script>
<link href="js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css" rel="stylesheet" type="text/css">
<link href="css/default.css" rel="stylesheet" type="text/css">
<script src="cordova.js"></script> <!-- phantom library, needed for Cordova api calls, added during build -->
<script src="js/app.js"></script> <!-- recommended location of your JavaScript code relative to other JS files -->
<script src="xdk/init-dev.js"></script> <!-- normalizes device and document ready events, see README for details -->
<script>
$(document).ready(function(){
$("#btnConsultarCodigo").click(function(){
console.log("click");
cordova.plugins.barcodeScanner.scan(function(resultado){
console.log(resultado);
$("#codigo").val(resultado.text);
}, function(){
$("#codigo").val("Erro ao ler o código");
});
});
});
</script>
</head>
<body>
<div role="page">
<div data-role="header">Crie sua Lista</div>
<div>
<input type="text" id="codigo">
<input type="button" id="btnConsultarCodigo" data-role="ui-btn ui-btn-inline" value="Consultar">
</div>
</div>
</body>
</html>
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the barcode scanner sample in the "Start a New Project"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
No i didn`t and i am ashamed for that.
I will try this one now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it doesn't work, try and add com.phonegap.plugins.barcodescanner via the third party plugins.
It has been tested on CLI 4.1.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thiago -- I tried the sample app, using the Debug tab, both with CLI 4.1.2 and CLI 5.1.1 and the sample app worked just fine.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page