Search code examples
androidandroid-imageandroid-drawable

Android: only use xxhdpi images


Is there any drawback in only using xxhdpi images and letting android scale the images? (Yes it might be more cpu intensive, but is it notable?) I tested it on a samsung s2 and the difference were small.

Is there a restriction to only use this if set minSdk to XX, becaus there were no xxhdpi?


Solution

  • Here are a couple drawbacks I can think of:

    • More CPU intensive to resize the images, the app will use more battery and might feel more sluggish, especially on older devices.
    • The images that you are going to load will be bigger and will use more memory. On mdpi/hdpi devices, the VM in which your app run will only have a smaller amount of heap memory available, and you might run into Out Of Memory Exceptions much more frequently if you only load high quality images.
    • The quality of the image might not be as good on mdpi/hdpi devices, because of the resizing. This really depends on what image you are loading, but images with sharp lines might appear a little blurred. But I also want to point out that this only applies if you are really making pngs for each size from a vector graphic. If you are just resizing your xxhdpi png into smaller one, you're probably doing the exact same thing that android is doing on the fly, so there will be no difference at all.