Stop Orientation change V33

Monkey Targets Forums/Android/Stop Orientation change V33

therevills(Posted 2011) [#1]
Since V33 I cant seem to find how to stop orientation change, I want my Android / iOS game to be always landscape.

Does anyone know how to do this now?

Thanks!


Virtech(Posted 2011) [#2]
After your first android build, open and edit this file:
your_project_folder\your_app.build\android\templates\AndroidManifest.xml


Look for the <activity> section, and add the following line
android:screenOrientation="landscape"


something like this...
<activity 
		android:name="MonkeyGame" 
		android:label="${APP_LABEL}"
		android:configChanges="keyboardHidden|orientation"
		android:theme=\"@..."
		android:screenOrientation="landscape">


Save
Now build your android app again, and it should work!:)

EDIT: In my FF4 the last codebox show line 5 in blue. I didnt highlight it! It should be green. The last line is the one to note.


therevills(Posted 2011) [#3]
Doh! I thought I tried that - Thanks Virtech.


Virtech(Posted 2011) [#4]
Maybe you edited ".build\AndroidManifest.xml" instead?

That one gets overwritten by the compilation process.

The manifest in templates is the right one to use.

Works for me! :)

Also here you can find some other values you can use:
http://developer.android.com/guide/topics/manifest/activity-element.html


Virtech(Posted 2011) [#5]
edit *doublepost?*


marksibly(Posted 2011) [#6]
Hi,

I think I'll add SCREEN_ORIENTATION to CONFIG.TXT for next release to make this a little easier.

Is there anything else in the manifest file that could be added to CONFIG.TXT?


Hima(Posted 2011) [#7]
What about access permission? Android apps need to ask for specific permissions before some features to work, like internet access, write to disk etc...

It would be really nice if we can do that in CONFIG.TXT instead of having to change the xml everytime :)


Virtech(Posted 2011) [#8]
An option to install the app as a live wallpaper would be awesome :)