What does mipmap-anydpi-v26 do in the res android studio 3.0 directory

In Android Studio 3.0, as soon as we create a project, res directorya folder with a name is automatically created in mipmap-anydpi-v26. What it really is and why we need it. How will we use this for development purposes.

In addition, after creating a project, two xml files are automatically created in this folder. Why are these xml files located in the mipmap folder, since we know that we must store the entire xml file in a directory with the ability to draw instead of mipmap.

+6
source share
2 answers

Android Studio 3 , SDK 26 . mipmap.

, , ic_launcher

android:icon="@mipmap/ic_launcher"

mipmap, 5 , - , sdk 26. sdk 26 xml anydpi-v26,

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
+8

, - :

, PNG API 26+, res/mipmap-anydpi-v26/ic_launcher.xml, :

<adaptive-icon
    xmlns:android="http://schemas.android.com/apk/res/android">
  <background android:drawable="@drawable/ic_launcher_background"/>
  <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

mipmap-anydpi-v26, dpi ( , , ) API 26+.

+1

All Articles