Android Landscape orientation issue

I have an app for iOS and Android – how can I force landscape-orientation (and only that) on both platforms? I understand it’s “landscapeLeft” on iOS and “landscape” on Android, but how do I combine the two conflicting names in a single build.settings file? The following didn’t work on Android:

settings = { orientation = { default = "landscapeLeft", supported = { "landscapeRight", "landscape" }, }, }

Thanks! [import]uid: 10284 topic_id: 24162 reply_id: 324162[/import]

Philipp, you need to change your settings like this…

[lua]settings = {
orientation = {
default = “landscapeRight”,
supported = {
“landscapeRight”,
“landscapeLeft”
},
},
}[/lua]

This is because Corona builds for Android 2.2, which does not support [lua]landscapeLeft[/lua]. Android did not add support for that orientation until 2.3.

Also, [lua]“landscape”[/lua] is not a supported keyword for the orientation setting. It needs to match the orientation settings you see on this web page…
http://developer.anscamobile.com/content/configuring-projects#Orientation_Support_iOS

I hope this helps! [import]uid: 32256 topic_id: 24162 reply_id: 97548[/import]

Thanks! Hope you guys might support other Android landscape orientations in the future, could be useful especially on the tablet! [import]uid: 10284 topic_id: 24162 reply_id: 97564[/import]

I’m using the build.settings that Joshua suggested, but the screen doesn’t auto-rotate on Android, only on iOS. I’m using build 704 of Corona.

Is there a way around this without going to a newer build? My client wants to support old iOS devices. [import]uid: 58455 topic_id: 24162 reply_id: 115652[/import]

Dave,

Android will not rotate your app if it is only set up for [lua]landscapeRight[/lua] and [lua]landscapeLeft[/lua]. Your app will only support orientation changes if you support both [lua]landscapeRight[/lua] AND [lua]portrait[/lua]. This is an Android 2.2 limitation, which is the minimum OS version that Corona supports on Android. I know it’s strange, but that’s just the way Google made it.

This is something that we’ve noted in our documentation here…
http://developer.coronalabs.com/content/configuring-projects#Note-4
[import]uid: 32256 topic_id: 24162 reply_id: 115686[/import]

Thanks, Joshua. Got this working, even though we have to rotate through portrait mode, which doesn’t work for our app. Fortunately, most users will have their device fix mounted in their car in one landscape mode or the other, so that is a non-issue. [import]uid: 58455 topic_id: 24162 reply_id: 120491[/import]

Great! I’m glad you got it working. Happy to help! [import]uid: 32256 topic_id: 24162 reply_id: 120521[/import]

Thanks, Joshua. Got this working, even though we have to rotate through portrait mode, which doesn’t work for our app. Fortunately, most users will have their device fix mounted in their car in one landscape mode or the other, so that is a non-issue. [import]uid: 58455 topic_id: 24162 reply_id: 120491[/import]

Great! I’m glad you got it working. Happy to help! [import]uid: 32256 topic_id: 24162 reply_id: 120521[/import]