Making an Android app run full screen and landscape

Sunit Prasad picture Sunit Prasad · Jan 6, 2013 · Viewed 68.6k times · Source

I have seen certain apps, especially most of the games (Eg. Angry Birds, Temple Run etc) run fullscreen and in landscape mode when launched. Their orientation never changes and they never exit fullscreen when the screen is touched. How its done? What properties do I need to change or code?

Answer

Tom Leese picture Tom Leese · Jan 6, 2013

If you prefer to use XML, you can change the AndroidManifest.xml:

<activity android:name="..."
    android:screenOrientation="landscape"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

</activity>

If you are targetting Android SDK 9 or above, you can use sensorLandscape instead of landscape which will mean that the screen will look the correct way up on both normal landscape orientation and reverse landscape orientation.