Software Archive
Read-only legacy content

Trying to force Landscape only mode.

Claude_N_
Beginner
787 Views
Testing on a Nexus 7 I have set Orientation in the project build-settings to "Landscape" Have added "device" to the plugins. Have added intel.xdk.device.setRotateOrientation("landscape"); to my code. This works to force the emulator to be in landscape. But when I use debug on the Nexus 7 it loads in whatever orientation the tablet is being held. I gathered the above attempts from various suggestions on the forum. Looked into the "Orientation" sample file. Did not see anything in there that would force a particular orientation. The sample seems to be related to modifying the dom display in response to orientation change. Nice example but seems to be unrelated to forcing landscape only only. Is this a Nexus 7 problem? Or, perhaps Crosswalk is not setup to handle this? Thanks for any clues.
0 Kudos
5 Replies
PaulF_IntelCorp
Employee
787 Views

Try setting the Crosswalk build settings to Crosswalk 14.

0 Kudos
Arve_S_
Beginner
787 Views

Hi

I have the same problem. The app is possible to autorotate even though i have set the setting intel.xdk.device.setAutoRotate(false);

 

The weird thing is that users with the app already on their phone can not auto rotate, but new users that downloads the app are able to autorotate. How can that happen?

This is for android users.

0 Kudos
PaulF_IntelCorp
Employee
787 Views

Do not use those intel.xdk plugins, they have been deprecated and are not being maintained.

Many people have used this plugin to control the screen orientation, with good results. I recommend you give it a try: https://github.com/gbenvenuti/cordova-plugin-screen-orientation -- you need to add it as a third-party plugin. I recommend you add it as a "git repo" plugin and specify the git location this way:

This will insure you get a version that the author has marked as "released" rather than something that is a work in progress.

0 Kudos
Claude_N_
Beginner
787 Views
Thanks Paul, I will give it a try. If you don't mind my asking (I'm new to adding third-party plugins to cordova) where does one use the "cordova plugin add net.yoik.cordova.plugins.screenorientation" That looks like a command line type syntax. I've been working entirely within the XDK. So this is a new adventure. Is there a faq or tutorial I can refer to?
0 Kudos
Swati_S_Intel1
Employee
787 Views

You can add a third party plugin on the Projects page > Plugins and Permissions > Third Party Plugins

Please see this article : https://software.intel.com/en-us/xdk/docs/adding-third-party-plugins-to-your-xdk-cordova-app

0 Kudos
Reply