Search code examples
androidmanifestdrawable

What to use mipmap or drawable


I am new android user and using Android Studio 1.3. I want to create simple splash screen, for that,i create different drawable folders where i store splash screen background images. I copy all ic_launcher from respective mipmap folders and paste them in respective drawable folders. and change icon path in manifest also.as,

 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">

to,

 <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

but this is giving me error that,

Error:(14, 24) No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher').

My question is,

  1. Does we always need to store app icons in mipmap folders only? why?

  2. When to use mipmap and drawable?


Solution

  • Using mipmaps for your launcher icon is described as best practice by the Android team. The advantage you get is that you can keep resources in the mipmap folders for all device densities and then strip out other resources from the drawable folders that are not relevant to the specific users device density.

    For example a user has a device that is classified as xxhdpi. The drawable resources in your apk for all other densities, such as xxxhdpi, are not required and can be stripped out.

    reference