When designing and developing mobile applications, the form factor and size factor plays a dominant role. Taking the major players into account, iOS devices come in finite screen sizes and form factors, Windows phone follows the same, Black berry too BUT when it comes to Android eco-system, the form and screen sizes vary as much as 100+.
The Android developer team has come up with solutions for that, this article will exclusively focus on the solution provided by the jargon filled Android techies in simpler terms, well as much as possible.
For theoretical and practical reasons, Android has split the screen size as small, normal, large and xlarge.
And for the matter of densities of the screen, Android has split them as ldpi, mdpi, nodpi and tvdpi.
Venturing into designing for multiple android screens, we have
- “Decide and Declare” what screens to support before-hand!
- Separation leads to unification!
- Use layout dimensions wisely.
- Say NO to hard coding pixels.
- Go easy on “Absolute”
- Go specific on the assets!
As a very first step determine what screen sizes is to be supported for your app. Once it is selected, declare them in your Manifest.xml file.
While designing for your Android applications, keep two factors in mind – Size and Density.
Design separately for various layouts for different screen sizes first. Following which you need to design drawables for different screen densities, combining these drawables to create your application that works flawlessly across multiple screens and devices.
Your android application uses a mandatory Height and Width units for all the views. These are stored in a XML file, make sure you use a "wrap_content", "fill_parent" or dp units for defining your layouts.
As a general rule of thumb, avoid hard coding and well, inform your development team if you’re not going to code!
Hard coding pixels values in your code will make it unmanageable later to alter or add additional screen supports.
Android provides two different layouts called –Absolute layout and Relative layout. It is always wise to go for Relative layout rather than absolute layout provided if your app has to work only in a narrow screen sizes.
When supporting multiple screens, use appropriate design assets and resources and put them under appropriate directories using proper qualifiers.
res/drawable-mdpi/icon.png //for medium-density screens
res/drawable-hdpi/icon.png //for high-density screens
There is no stoppage to making your app work, you can even try out strange ways rather, and this article mainly lists the best practices that Android itself recommends!
Appie coding time!