- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having a problem. My Code works fine in the emulator but I am unable to run it on my phone.
I am just trying to setup a basic QR code reader. Here is the code
<!DOCTYPE html> <html> <head> <title>Blank Hybrid App Project Template</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <style> @-ms-viewport { width: 100vw ; zoom: 100% ; } @viewport { width: 100vw ; zoom: 100% ; } @-ms-viewport { user-zoom: fixed ; } @viewport { user-zoom: fixed ; } </style> <script src="lib/ft/fastclick.js"></script> <link rel="stylesheet" href="css/app.css"> </head> <body> <button onclick="scanNow();">Scan</button> <script src="intelxdk.js"></script> <script src="cordova.js"></script> <script src="xhr.js"></script> <script src="js/app.js"></script> <script src="js/init-app.js"></script> <script src="js/init-dev.js"></script> <script> function scanNow() { //this function launches the QR Code scanner. intel.xdk.device.scanBarcode(); } //this event is fired when scanning is completed document.addEventListener("intel.xdk.device.barcode.scan",function(evt){ if (evt.success == true) { //successful scan alert(evt.codedata); } else { //failed scan alert("Please try again"); } },false); </script> </body> </html>
- Tags:
- HTML5
- Intel® XDK
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please use the Cordova equivalent. See this thread: https://forums.html5dev-software.intel.com/viewtopic.php?f=26&t=7552
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page