When should I use mipmaps?

After Google started adding mipmaps I ended up not searching exactly why. Even with this addition, it doesn't stop anything from using the Drawable as it was before.

Before

res/
    drawable-mdpi/ic_launcher.png (48x48 pixels)
    drawable-hdpi/ic_launcher.png (72x72)
    drawable-xhdpi/ic_launcher.png (96x96)
    drawable-xxhdpi/ic_launcher.png (144x144)
    drawable-xxxhdpi/ic_launcher.png (192x192)

Today

res/
    drawable/
    mipmap-mdpi/ic_launcher.png (48x48 pixels)
    mipmap-hdpi/ic_launcher.png (72x72)
    mipmap-xhdpi/ic_launcher.png (96x96)
    mipmap-xxhdpi/ic_launcher.png (144x144)
    mipmap-xxxhdpi/ic_launcher.png (192x192)

Even though I saw some questions, I still didn't understand exactly what the real meaning of having these changes was. In the old applications still remain drawable and apparently do not undergo any changes and they continue with the same purpose.

In Project

insert the description of the image here I did a brief search and found some answers, but not as satisfying as that.

What is the real difference between Mipmap and Drawable ? When should I use mipmap ? Is there any limitation in case I use Drawable ?

Author: ramaral, 2016-09-22

1 answers

, The difference between the portfolio drawable and mipmap it is when the application is installed on a device with a specific screen density, in the the world in the relation to the other densities are disposed in the first and held on in the second.

But then, you ask, why do I need to keep the Resources for the other densities?

The reason is that some devices have the " launcher icons " Increased up to about 25%, if there is a icon at a higher resolution it will be using instead of being magnified, thus maintaining image quality.

Thus, the folder mipmap it should be used primarily for the "launcher icons".

However, starting with Android 4.2, it is possible to use a mipmap as Source of objects bitmap and, after Android 4.3, also on objects BitmapDrawable , allowing you to maintain image quality, for example, during an animation that involves reductions/enlargements.
Having the various images in the folder mipmap and using the methods setHasMipMap() and hasMipMap(), Android will be able to choose the one that best suits each frame of the animation.

Source:

 4
Author: ramaral, 2016-09-23 14:20:25