Handling Multiple Screen Sizes, Part One

This is the first part of a several part series on handling multiple screen sizes in your Android projects. This material is adapted from a chapter in The Busy Coder’s Guide to Android Development, Version 3.0.

For the first year or so since Android 1.0 was released, all production Android devices had the same screen resolution (HVGA, 320×480) and size (around 3.5″ / 9cm). Starting in the fall of 2009, though, devices have been arriving with widely disparate screen sizes and resolutions, from tiny QVGA (240×320) screens to much larger WVGA (480×800) screens.

Of course, users will be expecting your application to be functional on all of these, and perhaps take advantage of larger screen sizes to add greater value. To that end, Android 1.6 added new capabilities to help better support these differing screen sizes and resolutions.

The Android documentation has extensive coverage of the mechanics of handling multiple screen sizes. These blog posts are designed to complement that coverage.

Let’s suppose, though, that you start off by totally ignoring the issue of screen sizes and resolutions. What happens?

If your application is compiled for Android 1.5 or lower, Android will assume your application was designed to look good on the classic screen size and resolution. Android will then automatically do the following:

  • If your application is installed on a device with a larger screen, Android will run your application in “compatibility mode”, scaling everything based on the actual screen size. So, suppose you have a 24px square PNG file, and Android install and runs your application on a device with the standard physical size but a WVGA resolution (a so-called “high-density” screen). Android might scale your PNG file to be 36px when it displays it, so it will take up the same visible space on the screen. On the plus side, Android handles this automatically; on the minus side, bitmap scaling algorithms tend to make the images a bit fuzzy.
  • Android will block your application from running on a device with a smaller screen. Hence, QVGA devices, like the HTC Tattoo, will be unable to get your application, even if it is available on the Android Market.

If your application is compiled for Android 1.6 or higher, Android assumes that you are properly handling all screen sizes, and therefore will not run your application in “compatibility mode”.

The next post in the series will begin providing tips for how to design layouts that will work independent of resolution.

About author

AndroidGuys
AndroidGuys 4625 posts

Founded on November 5, 2007, we've enjoyed bringing you the latest in Android news and rumors. Updated daily, we strive to deliver reviews, opinions, and updates on all things related to Android.

You might also like

News and Rumors

Google sells Motorola Home to Arris for $2.35 billion…among other things

The big news today in the Google-verse (for those that haven’t been tuned in) is the big G’s sale of their Motorola set-top box division, Motorola Home. For $2.05 billion

News and Rumors

Motorola Expects Less Than 1.5 Million Xoom Sales for 2011

Motorola said yesterday that it forecasts between 1.3 million to 1.5 million tablets sales for the course of 2011, with numbers continuing to taper in the face of stronger competition.

News and Rumors

Dual Screen Samsung Continuum Spied

Two new Samsung devices in one day! It was just over a month ago when we saw the year-end roadmap for Verizon come to light. Among the unknown/unseen handsets teased was a Samsung i400 “Continuum” which was said to be a mid-range phone. Flash forward to today and we see that we’re looking at another Galaxy S class phone. This time, there’s a twist.

6 Comments

  1. @cgiridhar
    February 17, 02:57 Reply

    i am facing exactly the same issue now. so looking forward for the rest of the series

  2. Besides the information about its interesting features, I appreciate this for it is the first part of a several part series on handling multiple screen sizes in your Android projects. Great news.

  3. dealing with anxiety
    May 22, 20:01 Reply

    As a rule, users do prefer big screen sizes and high resolutions.  They would be glad to learn about the feature of handling multiple screen sizes.

  4. old car
    August 08, 19:52 Reply

    It is a matter of excitement and fun to have various benefits of multi-screen over a single  monitor.  It is quite interesting information for everyone to learn to handle this feature.

Leave a Reply