From 69223702e4aa248791f0a0d858f8225d41ee67ef Mon Sep 17 00:00:00 2001
From: Rich Slogar ldpi (low), mdpi
hdpi (high), xhdpi extra-high), xxhdpi
(extra-extra-high), and xxxhdpi (extra-extra-extra-high). For example, bitmaps
for high-density screens should go in {@code drawable-hdpi/}.
Note: the drawable-xxxhdpi
+
Note: The mipmap-xxxhdpi
qualifier is necessary only to provide a launcher icon that can appear larger than usual on an
xxhdpi device. You do not need to provide xxxhdpi assets for all your app's images.
Some devices scale-up the launcher icon by as much as 25%. For example, if your highest
density launcher icon image is already extra-extra-high-density, the scaling process will make it
appear less crisp. So you should provide a higher density launcher icon in the
-drawable-xxxhdpi directory, which the system uses instead of scaling up a smaller
+mipmap-xxxhdpi directory, which the system uses instead of scaling up a smaller
version of the icon.
See Provide an xxx-high-density launcher icon for more information. You should not use the @@ -362,6 +362,16 @@ xxx-high-density launcher icon for more information. You should not use the +
Note: Place all your launcher icons in the
+res/mipmap-[density]/ folders, rather than the res/drawable-[density]/
+folders. The Android system retains the resources in these density-specific folders, such as
+mipmap-xxxhdpi, regardless of the screen resolution of the device where your app is installed. This
+behavior allows launcher apps to pick the best resolution icon for your app to display on the home
+screen. For more information about using the mipmap folders, see
+Managing Projects Overview.
+
The size and density configuration qualifiers correspond to the generalized sizes and densities described in Range of screens supported, above.
@@ -538,9 +548,9 @@ screen sizes (instead of using the size qualifiers in table 1). sizes and densities, see Range of Screens Supported, earlier in this document. -For example, the following is a list of resource directories in an application that -provides different layout designs for different screen sizes and different bitmap drawables -for medium, high, and extra-high-density screens.
+For example, the following application resource directories provide different layout designs
+for different screen sizes and different drawables. Use the mipmap/ folders for
+launcher icons.
res/layout/my_layout.xml // layout for normal screen size ("default")
@@ -548,10 +558,16 @@ res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra-large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra-large in landscape orientation
-res/drawable-mdpi/my_icon.png // bitmap for medium-density
-res/drawable-hdpi/my_icon.png // bitmap for high-density
-res/drawable-xhdpi/my_icon.png // bitmap for extra-high-density
-res/drawable-xxhdpi/my_icon.png // bitmap for extra-extra-high-density
+res/drawable-mdpi/graphic.png // bitmap for medium-density
+res/drawable-hdpi/graphic.png // bitmap for high-density
+res/drawable-xhdpi/graphic.png // bitmap for extra-high-density
+res/drawable-xxhdpi/graphic.png // bitmap for extra-extra-high-density
+
+res/mipmap-mdpi/my_icon.png // launcher icon for medium-density
+res/mipmap-hdpi/my_icon.png // launcher icon for high-density
+res/mipmap-xhdpi/my_icon.png // launcher icon for extra-high-density
+res/mipmap-xxhdpi/my_icon.png // launcher icon for extra-extra-high-density
+res/mipmap-xxxhdpi/my_icon.png // launcher icon for extra-extra-extra-high-density
For more information about how to use alternative resources and a complete list of @@ -560,7 +576,7 @@ configuration qualifiers (not just for screen configurations), see Providing Alternative Resources.
Be aware that, when the Android system picks which resources to use at runtime, it uses -certain logic to determing the "best matching" resources. That is, the qualifiers you use don't +certain logic to determine the "best matching" resources. That is, the qualifiers you use don't have to exactly match the current screen configuration in all cases in order for the system to use them. Specifically, when selecting resources based on the size qualifiers, the system will use resources designed for a screen smaller than the current screen if there are no resources @@ -703,10 +719,10 @@ such, you can now specify that these layout resources should be used only when t smallest width your layout supports once it's complete.
Note: Remember that all the figures used with these new size APIs -are density-indpendent pixel (dp) values and your layout dimensions should also always be defined +are density-independent pixel (dp) values and your layout dimensions should also always be defined using dp units, because what you care about is the amount of screen space available after the system accounts for screen density (as opposed to using raw pixel resolution). For more information about -density-indpendent pixels, read Terms and concepts, earlier in this +density-independent pixels, read Terms and concepts, earlier in this document.
@@ -728,7 +744,7 @@ Also beware that the Action B a part of your application's window space, although your layout does not declare it, so it reduces the space available for your layout and you must account for it in your design. -Table 2. New configuration qualifers for screen size +
Table 2. New configuration qualifiers for screen size (introduced in Android 3.2).
| Screen configuration | Qualifier values | Description |
|---|