Software Archive
Read-only legacy content
17060 Discussions

Problems with onDeviceReady event

Slavi_I_
Beginner
248 Views

Hi,

First I want to say that all the things work in the emulators but when I build it and test it on a device they don't.

I wanted to set my orientation to landscape so I followed the examples with :

document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);               
function onDeviceReady(){
    intel.xdk.device.setRotateOrientation('landscape');
    intel.xdk.device.hideSplashScreen();   
}  

When I use it in "Test" mode, push the files on the server and then download the app from the cloud it works fine.

But when I build the app using Build-> Clicking Build for android from the "Cordova 3.X Hybrid Mobile App Platforms" menu, then download it and install it, it does not work.

You could say that I could build the app from the "Legacy Hybrid Mobile App Platforms" menu and then in the "Assets" menu to choose landscape. Yes that works but I want also to use hideStatusBar() which also requares the onDeviceReady event to fire.

I'm testing it on Galaxy S2 with Android 4.1.2

0 Kudos
2 Replies
Vijay_R_1
Beginner
248 Views

Why not use the below code?

$.afui.ready(function(){
console.log('afui is ready');
​});

 

0 Kudos
Slavi_I_
Beginner
248 Views

For what library is the refference "$" here for? What should I include?

0 Kudos
Reply