Saturday, April 21, 2012

Android Development: Disable Screen Rotation

By default, your app will run in Portrait mode.  And you might opt to keep it that way, but would also rotate to Landscape mode if the phone it handled sideways.

To keep it in Portrait mode, open your AndroidManifest.xml then add the highlighted text below.

<activity
   android:label="@string/app_name"
   android:name="HelloWorld"
   android:screenOrientation="portrait" >
   ...
< /activity>

But if you are creating an Android game, chances are you wanted to default it in Landscape and stay that way. If so, just change portrait to landscape.

1 comment:

stanly bertn said...

YOU have shared useful information...
Android developer creates a huge range of apps. Popular ones are Angry Birds, Skype, YouTube Mobile, The Weather Channel, Facebook Mobile, and so on.