In Android Studio 3.0, once we create a project, a folder named mipmap-anydpi-v26
is automatically created in the res
directory. What actually does it do? Why do we need it? How will we utilize it for development purposes?
Also, there are two XML files automatically created in this folder after project setup. Why do these XML files reside in a mipmap folder? I thought we should keep all XML files in a drawable folder instead of mipmap.
I have found an explanation about this, here is some context:
To add an adaptive icon that replaces all PNGs on API 26+ devices, you’ll add a
res/mipmap-anydpi-v26/ic_launcher.xml
file that looks like this:By placing it in the
mipmap-anydpi-v26
folder, the resource system will use it in preference over any files in the other dpi folders (exactly what you want, since this file is replacing all of them) and that it should only be used in API 26+ devices.