Thursday, February 19, 2015

Android: mipmaps instead of drawables

I started to use MIP (latin "multum in parvo", or "much in little") maps in Android 4.3 code, but I still have to come up with a good explanation of this optimization technique.


Google says:

It’s best practice to place your app icons in mipmap- folders (not the drawable- folders) because they are used at resolutions different from the device’s current density. For example, an xxxhdpi app icon can be used on the launcher for an xxhdpi device.


in AndroidManifest.xml


<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher">
instead of
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">