Book Image

Mastering Android Game Development

By : Raul Portales
Book Image

Mastering Android Game Development

By: Raul Portales

Overview of this book

Table of Contents (18 chapters)
Mastering Android Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
API Levels for Android Versions
Index

Designing for multiple screen sizes


While we have designed our GameView to scale equally in all screen sizes and aspect ratios by making use of the appropriate screen units, Android views do not work this way; however, we can follow the standard Android procedures for them.

For apps, it is recommended that you tweak the layout based on the screen size. For games it makes sense to keep the same layout across all screen sizes and only vary the size and margins of some items.

Note

Games should keep the same layout for all screen sizes.

As a rule of thumb, you should always use RelativeLayout to design your layouts, where every item on the screen is positioned relative to something else. This allows the layout to adapt smoothly to all screen sizes. This concept is at the core of responsive design.

To have a proper display in all screen sizes, we are going to qualify the dimensions; this is included on the Android SDK and is recommended practice.

Note

Qualifying dimensions is a best practice for apps...