Android: drawable resolutions

Select0r picture Select0r · Feb 15, 2011 · Viewed 11.3k times · Source

I've been through this post (and others) as well as through the documentation about supporting different screen resolutions in Android, but I couldn't find a clear answer to a (simple) question:

Is it ok to just use "res/drawable" for images in an android app?

Background: The only images that are needed in this specific app are the app icon itself and an icon for a notification, there won't be any images in any layout.
So in my understanding, if no "hdpi"-, "mdpi"- and "ldpi"-folders are found, Android will use "res/drawable" as the fallback.
As the only pitfall with different screen-resolution seems to be that Android will scale images for a specific resolution if no special one is found, this should only be a problem when UPscaling, because the image will get blurry. But if I provide all "hdpi"-images in "res/drawable" (instead of 3 different ones), won't Android just DOWNscale those images if the size is too big?
If that's true, I could save some APK-space by just a third of the images.

Follow-Up question: I read that for API-level 3 a dir by the name "drawable-v3" is required. Is that true or is "drawable" the fallback for this API-level also?

Any hint is appreciated.

Answer

Ollie C picture Ollie C · Feb 15, 2011

The images in the drawables folder are assumed to be at mdpi resolution, so they will get scaled up/down if you don't provide the others.

Scaled up images will be low-resolution and look fuzzy. Scaled down images will have pixels missing and look jaggy.

So your app will "work" with only one set of default images, but will look awful on many devices. I strongly advise that you create the images in different sizes, so it looks great on all devices - it's a bit boring, but not hard to do.

It won't be long before we have xhdpi devices, so while you're at it you may want to create those too.

I assume you've read this