Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mipmaps vs. drawable folders [duplicate]

I'm working with Android Studio 1.1 Preview 1. I noticed that when I create a new project I'm getting the following hierarchy:

Enter image description here

Mipmap folders for different DPIs, no more different DPIs drawable folders.

Should I put all my resources in the mipmap folders, or just the app icon?

like image 547
David Avatar asked Jan 21 '15 10:01

David


People also ask

What is the difference between mipmap and drawable?

The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.

What is mipmap used for?

Android introduced mipmap drawables for providing more flexibility to design the launcher icons. mipmap first introduced in Android Jelly Beans 4.3. If you are building different versions of your app for different densities, you should know about the mipmap resource directory.

What is the difference between drawable and drawable v24?

Classic drawable resources such as images are stored in the drawable folder. In contrast, vector drawables are stored in drawable-v24 . For this project, keep the drawable default and click OK.

What is mipmap Anydpi v26?

anydpi-v26: This is an additional filter over just anydpi. This says resources will always be picked up from anydpi-v26 regardless of devices density only if SDK/API level is 26 or higher(Oreo). So you can have mipmap-anydpi-v26 or drawable-anydpi-v26. All resource folders will follow above logic.


1 Answers

The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.

According to this Google blogpost:

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.

When referencing the mipmap- folders ensure you are using the following reference:

android:icon="@mipmap/ic_launcher"

The reason they use a different density is that some launchers actually display the icons larger than they were intended. Because of this, they use the next size up.

like image 60
Joel Avatar answered Oct 21 '22 23:10

Joel