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

Get Android Game Programming: A Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.