O'Reilly logo

Android: Game Programming by Raul Portales, John Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required