The app i am developing should be displayed only in landscape mode.
In my app descriptor i have
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
On iOS devices app is launched in landscape mode and everything works as expected.
But when i tried to deploy on my android device ( Samsung galaxy S3 ), the app is launched in portrait mode.
When I modify the descriptor file to read :
<aspectRatio>landscape</aspectRatio>
<autoOrients>true</autoOrients>
then the app will be changing orientation.
While debugging i found out that the apps orientation when starting is stage.orientation == "default"
Also i have added android:screenOrientation="landscape" to android specific configurations in my app.xml (the app descriptor file):
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
<application android:enabled="true">
<activity android:excludeFromRecents="false" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
]]>
</manifestAdditions>
<!--Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
<!--<colorDepth></colorDepth>-->
</android>
Is this a known issue? What could be the cause of this?
EDIT:
I ended up using stage.setAspectRatio( StageAspectRatio.LANDSCAPE ); in my main class. It will work even with devices that have default orientation other than PORTRAIT