- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not understand what happens with App Preview, the issue is that do not show the same result as Emulator, when I invoke a command like intel.xdk... do not work and the app is stopped this happens with IOS App Preview and Android App Preview but in Emulator everything works fine... here is the code.
HTML
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="intelxdk.js"></script>
<script src="cordova.js"></script>
<script src="xhr.js"></script>
<script src="js/app.js"></script>
Jscript
var rest_url = 'http://www.biipitdev.com/';
var device_id = null;
var iPhoneFlag = false;
var windowHeight;
var init = function () {
windowHeight=window.innerHeight;
if( navigator.userAgent.match(/iPhone|iPod/) ){
iPhoneFlag = true;
}
};
window.addEventListener("load", init, false);
/**
* Prevent Default Scrolling
*/
var preventDefaultScroll = function(event)
{
// Prevent scrolling on this element
event.preventDefault();
window.scroll(0,0);
return false;
};
$( document ).bind( 'mobileinit', function(){
$.mobile.loader.prototype.options.text = "loading";
$.mobile.loader.prototype.options.textVisible = false;
$.mobile.loader.prototype.options.theme = "a";
$.mobile.loader.prototype.options.html = "";
});
window.document.addEventListener("touchmove", preventDefaultScroll, false);
var onDeviceReady = function() {
//alert('device ready');
//get a unique device_id
device_id = device.uuid; intel.xdk.notification.alert(device_id);
//hide splash screen
if( window.Cordova && navigator.splashscreen ) { // Cordova API detected
intel.xdk.device.hideSplashScreen();
}
//set orientation
intel.xdk.device.setRotateOrientation("portrait");
intel.xdk.device.setAutoRotate(true);
//manage power
intel.xdk.device.managePower(true,false);
};
//onDeviceReady();
document.addEventListener("deviceready", onDeviceReady, false) ;
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By "do no work" do you mean you get an error? What error?
You could wait for the "intel.xdk.device.ready" event, which at least for me, always fires after Cordova's deviceReady.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look now I have another issue...
I changed the order of the scripts call in index.html and now works, but the problem now is when I invoke the camera comes a black screen with a cancel button at bottom only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You really need to work on providing more useful information to people if you want help. Are you getting a black screen on a device or in the emulator? What device? How are you invoking the camera, etc, etc, etc, etc, etc, etc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting a black screen in device (Iphone and Samsung), in emulator works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How are you invoking the camera?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
document.addEventListener("intel.xdk.device.barcode.scan", barcodeScanned, false);
intel.xdk.device.scanBarcode();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK - wow, so your question was about the camera but the reader is supposed to guess the barcode scanner. I have to grab a sandwich, but I'll throw this in an app in about 30 minutes to see what happens.
In the interim- It is worth noting that in this thread - found by searching "barcode" on this forum- John H from Intel suggests checking if a third party plugin works. Note that since the app preview cannot use "non-standard" plugins you could only test this with a built app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I develop a similar app the last year and intel.xdk.device.barcode.scan works fine, the problem is after updated the app preview for IOS 8.x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That information would also have been useful.
In any case, I used the sample app code from https://software.intel.com/en-us/node/493036
Works fine in Android App preview at least for on-device debugging using Crosswalk. I did not do USB cable for iOS since I avoid the mac as much as I can. But it does not work on App Preview via Wifi with iOS 8.2. I too get the black screen with cancel button.
Not certain it is the source of the troubles, but my experience is that Apple often breaks stuff with their camera - was an issue with a native app I dealt with last year as well. You might be best finding a third party plugin whose author is willing to keep up with Apple's changes.Since September of last year, Apple have released iOS 8.0, a week later 8.01, a day later 8.0.2, then of course we had 8.1, 8.1.1 ,8.1.2, 8.1.3 and now 8.2.
Best of luck with it, in any case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes is the same example that I took and make a modification for my App, but is weird because before works perfectly and now doesn't work, like you said the problem is with the version of IOS... let me research in Apple Forums about.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By the way I added a third party Cordova Barcode Scanner to my project and now I gets Can not read property barcodescanner.. at the end I am still stuck in the same point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't forget that the third party plugin will only work in build apps - you can't test them using AppPreview. I recognize the challenge in supporting this, but in my opinion every minute of effort put into the AppDesigner GUI builder would be better spent implementing a feature like that. Frankly, Intel could probably make a nice packet if they just added that as "premium" offering on the free XDK. I am not sure what i would pay for it, but I am pretty certain more than they would dare to charge for a personal developer license.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We're working on an on-device debug solution that would allow debugging with third-party apps. Company policy does not allow me to say when that feature will be available, but we are working hard on solving that problem and recognize it's value.
@Barrett -- I'll forward your comment regarding App Designer to our project manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Paul. I appreciate, and probably not even fully, the complexity of implementing it, and also think that it's the sort of feature that anyone doing this commercially, even if as a sideline, would be willing to pay at least something for given the massive time savings it would offer. Your on-device debugging facilities are a real timesaver even within the 3rd party plugin restriction. The only things I am thinking about extra plug-ins for are a couple of bells & whistles so I am saving rolling those in until near the end.

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