title: Mipmap drawables for icons
body: <p>Since Android 4.3 (Jelly Bean) we can now make use of the <code>res/mipmap</code> folders to store "mipmap" images.</p>
  
  <p>For example, <em>Chrome for Android</em> stores its icons in these folders instead of the more normal <code>res/drawable</code> folders.</p>
  
  <p><strong>How are these mipmap images different from the other familiar drawable images?</strong></p>
  
  <p>I see that in my manifest, we use the <code>@mipmap/</code> qualifier, instead of <code>@drawable/</code>, which makes sense given the resource folder name:</p>
  
  <pre><code>&lt;activity
      android:name=".MipmapDemp"
      android:icon="@mipmap/ic_launcher" /&gt;
  </code></pre>
  
  <hr>
  
  <h2>References:</h2>
  
  <p>The <a href="https://developer.android.com/about/versions/android-4.3.html" rel="noreferrer">Android 4.3 APIs</a> document has the following to say:</p>
  
  <blockquote>
    <p>Using a mipmap as the source for your bitmap or drawable is a simple
    way to provide a quality image and various image scales, which can be
    particularly useful if you expect your image to be scaled during an
    animation.</p>
    
    <p>Android 4.2 (API level 17) added support for mipmaps in the Bitmap
    class—Android swaps the mip images in your Bitmap when you've supplied
    a mipmap source and have enabled setHasMipMap(). Now in Android 4.3,
    you can enable mipmaps for a BitmapDrawable object as well, by
    providing a mipmap asset and setting the android:mipMap attribute in a
    bitmap resource file or by calling hasMipMap().</p>
  </blockquote>
  
  <p>I don't see anything in there that helps me to understand.</p>
  
  <hr>
  
  <p><a href="http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap" rel="noreferrer">XML Bitmap resources</a> have an <code>android:mipMap</code> property:</p>
  
  <blockquote>
    <p>Boolean. Enables or disables the mipmap hint. See setHasMipMap() for
    more information. Default value is false.</p>
  </blockquote>
  
  <p>This does not apply to launcher icons as far as I can see.</p>
  
  <hr>
  
  <p>The question was raised on Google Groups (<em><a href="https://groups.google.com/forum/#!topic/android-developers/ZUyF0JEwibs" rel="noreferrer">The purpose of resource name "mipmap"?!</a></em>), to which Romain Guy replied:</p>
  
  <blockquote>
    <p>It's useful to provide an image at a larger resolution that would
    normally be computed (for instance, on an mdpi device, Launcher might
    want the larger hdpi icon to display large app shortcuts.)</p>
  </blockquote>
  
  <p>I feel like this almost makes sense of it, but not quite.</p>
  
  <p>I'm still inclined to go with Randy Sugianto's follow up:</p>
  
  <blockquote>
    <p>What are the advantages of this? Is there any guide how to use
    mipmaps, probably for better launcher icons?</p>
  </blockquote>
  
  <hr>
  
  <p>Of course, <a href="http://en.wikipedia.org/wiki/Mipmap" rel="noreferrer">Wikipedia has a page for "Mipmap"</a>, which refers to an older technique invented in 1983, that I can't quite relate to the current Android implementation.</p>
  
  <hr>
  
  <p>Should we be storing all our <strong>app icons in <code>res/mipmap</code> folders</strong> these days, and what are the <strong>guidelines</strong> for these mipmap images?</p>
  
  <hr>
  
  <p><strong>Update #1</strong></p>
  
  <p>Here's a blog post that tries to explain it a bit.</p>
  
  <ul>
  <li><a href="http://programmium.wordpress.com/2014/03/20/mipmapping-for-drawables-in-android-4-3/" rel="noreferrer">Mipmapping for drawables in Android 4.3</a></li>
  </ul>
  
  <p>But the image used in that blog post shows what looks like one file with many logos in it. This is not what I see in Chrome's mipmap folder.</p>
  
  <p>Chrome's <code>mipmap-hdpi</code> folder contains three images. One is the Chrome logo, on its own.</p>
  
  <p><img src="https://i.stack.imgur.com/o75PM.png" alt="Chrome mipmap-hdpi icon.png"></p>
  
  <p>Strangely, it is 72x72, not 48x48 which I would expect to see.</p>
  
  <p>Perhaps that is all there is to this - we just need to keep bigger icons in the mipmap folders?</p>
  
  <hr>
  
  <p><strong>Update #2</strong></p>
  
  <p>The Android Developers Blog post of 23/10/2014 again confirms the idea of using the <code>mipmap</code> folders for application icons:</p>
  
  <ul>
  <li><a href="http://android-developers.blogspot.com/2014/10/getting-your-apps-ready-for-nexus-6-and.html" rel="noreferrer">Getting Your Apps Ready for Nexus 6 and Nexus 9</a></li>
  </ul>
  
  <p>When talking about the Nexus 6 screen density, the author writes:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <hr>
  
  <p><strong>Update #3</strong></p>
  
  <p>Note that Android Studio creates the <code>ic_launcher.png</code> icons in the <code>mipmap...</code> folders rather than the <code>drawable...</code> folders that Eclipse used to create them in.</p>
  
  <hr>