Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any disadvantage to using only high resolution image resources for an Android application?

The Android documentation says that best practices are to make two drawable directories - one for HDPI and one for MDPI. It also says that if the MDPI directory doesn't exist and a MDPI device is running the app, it will scale down the HDPI ones so everything looks good.

Is there any reason not to just make one high resolution set of graphics?

One con that I can think of is performance issues and one pro I can think of is only having one set of images for your app.

like image 282
Brandon O'Rourke Avatar asked Mar 09 '10 19:03

Brandon O'Rourke


People also ask

What is the disadvantage of a higher resolution image?

Downsides to working with ultra-high resolutions Another disadvantage of high-resolution cameras is that more megapixels mean more “heavy lifting” during image acquisition. This means slower continuous shooting and slower AF performance. Also, low light performance is better with lower resolution cameras.

Which is better to use high resolution images or low resolution images?

In graphic design, low resolution images are going to look pixelated, blurry and not as clear-cut as high resolution images. High resolution images are needed for print design in order to produce crisp, clear images. Lower resolution images can be used for web.

How important is a high resolution image for your application?

Hi-res images are at least 300 pixels per inch (ppi). This resolution makes for good print quality, and is pretty much a requirement for anything that you want hard copies of, especially to represent your brand or other important printed materials.

What does higher picture quality do?

Higher resolutions mean that there more pixels per inch (PPI), resulting in more pixel information and creating a high-quality, crisp image. Images with lower resolutions have fewer pixels, and if those few pixels are too large (usually when an image is stretched), they can become visible like the image below.


2 Answers

Basically, the situation with this could be extrapolated for most of the best practices:

You can do it otherwise, but most often that not, you shouldn't.

It's not that you can't go only with drawable-hdpi, but the addition of drawable-ldpi and drawable-mdpi offers you the ability to customize and fine tune your assets, at the price of bulking up a little your application.

Please, keep in mind that this bulking up won't be so dramatic - if you assume that:

  • the resource size is proportional to the pixel count
  • the differences between assets for different resolutions are proportional to the difference between resolutions

the folder drawable-mdpi will be just 37% of drawable-hdpi and drawable-ldpi will be just 18% of drawable-hdpi

Also suffixes for res folders are especially useful when used together - you can have full control over the application. In some cases, resources are pre-defined for a lot more than high-medium-low density screens, so I would say that you shouldn't worry that much for the additional bulk.

As you've thought out, you can avoid the dynamic scaling of the resources (worse than scaling beforehand). It won't be that much of a problem, but most of the time, if you can avoid operations on the device by doing additional preparations in the development/production process, that's a good thing.

like image 193
Dimitar Dimitrov Avatar answered Oct 20 '22 07:10

Dimitar Dimitrov


The only big downside of just using hdpi (for 90% of us who don't work in big teams with designed designer who can just worry about /res folder in project) is increased cpu & (more importantly) memory usage. I.e. - you have 320x480 device which loads and uses 1000x1000 images (they are scaled down on screen, but they use the same memory as if they were displayed in their full size).

Luckily, I just found this little gem that works pretty well - it autogenerates other sizes from your images in xhdpi:

https://code.google.com/p/android-drawable-converter/

Even better - it's configurable so you can add new size (xxhdpi) or just generate certain types (mdpi).

like image 21
nikib3ro Avatar answered Oct 20 '22 07:10

nikib3ro