Skip to content Skip to sidebar Skip to footer

How Can I Create Android Images With Good Resolution?

I'm creating an Android application. The main activity layout will have a background image that will wrap with the whole screen. What resolution should I use to create the backgrou

Solution 1:

The best way for you is to start reading this article, it contains the best practices for supporting multiple screen sizes and densities.

EDIT:

I use the following directories to store the drawables for maximum size and density optimization:

Small screens support

  • drawable-small-hdpi
  • drawable-small-ldpi

Normal screen support

  • drawable-normal-mdpi
  • drawable-normal-hdpi

Large screens support

  • drawable-large-mdpi

Tablet screen support

  • drawable-xlarge-mdpi

Of course not every time this solution is the best, aqs's solution is more common used. You can follow this site to track which screen sizes and density's are most used and decide which of the screens worth support for your application. And of course you can read about the Providing Alternative Resources to understand better what are your options.

Solution 2:

You should read Supporting multiple screens. You must define dpi on your emulator. 240 is hdpi, 160 is mdpi and below that are usually ldpi.

Extract from Android Developer Guide link above:

320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).  480dp: a tweener tablet like the Streak (480x800 mdpi).  600dp: a 7” tablet (600x1024 mdpi).  720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).

Solution 3:

IMHO answer of @Cata is a bit misleading because of mixing screen size and screen density for providing graphics.

I think the best practice is to distinguish this two things by providing:

  • different size images (PNGs) for different densities and
  • different layouts for different generalized screen sizes.

By doing so developer can reduce number of different images to 4 categories (ldpi, mdpi, hdpi, xhdpi) if he wants to support all currently existing densities. Of course XML layouts files for different (small, normal, large, xlarge) screen sizes are necessary if we support them but it is much easier to make/edit/correct/adjust xml files than PNGs.

A bit more details and explanation u can find in my previous answer about this topic on this link.

Hope u find this answer useful. Cheers.

Post a Comment for "How Can I Create Android Images With Good Resolution?"