For the More Curious: Mipmap Images

Resource qualifiers and drawables are handy. When you need an image in your app, you generate the image in a few different sizes and add the versions to your resource-qualified folders: drawable-mdpi, drawable-hdpi, etc. Then you reference the image by name, and Android figures out which density to use based on the current device.

However, there is a downside to this system. The APK file that you release to the Play Store will contain all of the images in your drawable directories at each density that you added to your project – even though many of them will not be used. That is a lot of bloat.

To reduce this bloat, you can generate separate APKs for each screen density. You would have an mdpi ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.