The difference between Drawable and Mipmap in the storage location of Android resource files





Drawable



The Drawable folder stores bitmap files (png, jpeg, gif), 9-patch files, and xml files that are used to describe drawable shapes or drawable objects that contain multiple states (normal, pressed, focused).
A total of android drawable files can include:

drawable-ldpi (low density)
drawable-mdpi (medium density)
drawable-hdpi (high density)
drawable-xhdpi (extra high density)
drawable-xxhdpi (extra high density)
drawable-xxxhdpi (extra ultra high density)
drawable- nohdpi (no scaling)
plus the default drawable of course.







Mipmap



The Mipmap folder is used to store the app's icon icon file. The Android system will retain all the image resources in this folder, regardless of the screen resolution of the device where the application is installed. This behavior allows the startup program to choose the best for the application. The resolution icon is displayed on the main screen.

A total of mipmap files for android can include:

mipmap -ldpi (low density)
mipmap -mdpi (medium density)
mipmap -hdpi (high density)
mipmap -xhdpi (extra high density)
mipmap -xxhdpi (extra high density)
mipmap -xxxhdpi (extra ultra high density)
mipmap - nohdpi (no scaling)




Guyu
Guyu 1




Summarize

It is recommended that you only put the pictures that need to adapt to the screen resolution and the app startup icon in the mipmap directory, which can improve display performance and occupy less memory; other pictures (
boot page background pictures, carousel pictures, giftu pictures, etc.) Shape resources The xml file is still placed inside the drawable.

The mipmap will scale the resource to the device resolution size

The drawable will scale the resource to a matching multiple of the size of the device


















Note:
Likes, comments, and reprints are welcome. Please give the link to the original text in an obvious place on the article page
. Those who know, thank you for reading my article in the vast crowd.
Where is the signature without personality!
For details, please follow me
and continue to update

Scan to have a surprise!
© 2022 09 - Guyu.com | [Copyright infringement must be investigated]

Guess you like

Origin blog.csdn.net/weixin_49770443/article/details/126947209