Android Programming: The Big Nerd Ranch Guide, Third Edition
by Bill Phillips, Chris Stewart, Kristin Marsicano
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 Google 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access