-2

Hi Guys And Ladies and the Others,

I develop a project. It have a lot of images. And it just run on 4.0 and above device. So If I resize all of images to xxhdpi, xhdpi blabla, the size of application became very huge. If Am I just create 72x72 (hdpi size), is it just enough ? Or do you suggest anything else ?

Thanks a lot for the answer..

Droid
  • 109
  • 1
  • 2
  • 7
  • possible duplicate of [How to support all the different resolutions of android products](http://stackoverflow.com/questions/6403619/how-to-support-all-the-different-resolutions-of-android-products) – Phantômaxx Dec 29 '14 at 08:18

2 Answers2

2

The proper way to do it is to have different bitmaps for each density. This is because high density images are ideally not just high resolution copies: they're custom designed with more detail in. Also, low density devices tend to be underpowered, and so have a hard time scaling down high resolution images.

It does depend on your application and your needs, though. You might find that your application runs at a decent speed, and looks OK, with just one image of each type.

Something else you should consider is whether you can use vector graphics for some of it, or a ninepatch, which will scale automatically.

chiastic-security
  • 20,430
  • 4
  • 39
  • 67
1

Lower quality images end up getting stretched on higher resolution screens, which can look pixelated. If you need to cut down on images, there are a number of approaches that I would suggest:

  1. Consider the format. If you need a rasterized image, does it need to be a PNG rather than a compressed JPEG image, for example? Can you get away with using an SVG (which would allow you to support all sizes and resolutions using a single image asset)?

  2. For rasterized images, consider whether you can tune the compression ratio.

  3. Try supporting the highest resolution, and then skip a few resolutions in between and provide some lower resolution images for lower resolutions where details appear lossy or where you seem to be getting a performance hit from downscaling the high resolution image (that is, xxhdpi will probably be fine on xhdpi and hdpi, but then you will likely want to provide separate mdpi and ldpi images).

Michael Aaron Safyan
  • 93,612
  • 16
  • 138
  • 200