5 Tips for Developing Applications for Multiple Screen Sizes in Android

By Michael Burton

Part of Android Application Development For Dummies Cheat Sheet

As a developer, you already know the importance of writing tests for your code. This is just as true for Android app development as it is for any other kind of development. Luckily, Android makes it easy to add tests to your app.

  • The size requirements for each icon in each density vary for each type of icon.

    You find launcher icons, menu icons, status bar icons, tab icons, and many more. They are all built differently for each screen density. When building these icons, reference the Android Iconography guidelines.

  • When defining your user interface, try to always use the density-independent pixel (dip or dp) measurement unit for views and the scale-independent pixel (sip or sp) for font sizes.

    This helps your application scale to different devices. The density-independent pixel is a virtual pixel that scales proportionally for each given screen density.

  • Provide the compatible-screens element to the AndroidManifest.xml file to help the Android market determine whether your application is compatible with various screen sizes.

    In general you should avoid compatible-screens, but sometimes it is necessary, such as when you are supplying multiple apks for different screen sizes.

  • Provide graphics for extra-extra-high-, extra-high-, high-, and medium-density devices.

    Although this may increase your development and design time, it greatly improves the usability and appearance of your application.

  • Use fragments liberally to make supporting tablet devices easier.