Book Image

Xamarin Mobile Application Development for Android, Second Edition

Book Image

Xamarin Mobile Application Development for Android, Second Edition

Overview of this book

Table of Contents (18 chapters)
Xamarin Mobile Application Development for Android Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Locking the Android application orientation


According to the Google design guidelines, the Android application must respond to the device orientation and display an appropriate layout for the given orientation. However, some kind of applications, such as games, video players, and so on, are intended to restrict the orientation to landscape or portrait only. For native Android applications, this can be achieved using the android:screenOrientation property to the <activity> declaration in the AndroidManifest.xml descriptor file. Xamarin makes this even simplified and recommends that you do not to edit the AndroidManifest.xml file manually at any point of time, instead it allows you to set all the application configuration metadata using [Activity] attribute custom properties to the activity declaration.

As we recall from Chapter 3, Creating the Points Of Interest App, we are already using some of the properties of the [Activity] attribute, such as Label, MainLauncher, and Icon. Now to...