Stop Orientation change V33
Monkey Targets Forums/Android/Stop Orientation change V33
| ||
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! |
| ||
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. |
| ||
Doh! I thought I tried that - Thanks Virtech. |
| ||
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 |
| ||
edit *doublepost?* |
| ||
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? |
| ||
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 :) |
| ||
An option to install the app as a live wallpaper would be awesome :) |