| Directory |
Resource Type |
animator/ |
XML files that define property animations. |
anim/ |
XML files that define tween animations. (Property animations can also are saved in this directory, but the animator/ directory is preferred for property animations to Distinguish between the types.) |
color/ |
XML files that define a state list of colors. See Color State List Resource |
drawable/ |
Bitmap files (,, .png .9.png .jpg , .gif ) or XML files that is compiled into the following drawable resource subtypes:
- Bitmap files
- Nine-patches (re-sizable bitmaps)
- State lists
- Shapes
- Animation Drawables
- Other Drawables
See Drawable Resources. |
mipmap/ |
drawable files for different launcher icon densities. For more information in managing Launcher icons mipmap/ with folders, see Managing Projects Overview. |
layout/ |
XML files that define a user interface layout. See Layout Resource. |
menu/ |
XML files that define application menus, such as an Options menu, Context menu, or Sub menu. See Menu Resource. |
raw/ |
Arbitrary files to the save in their raw form. To open these resources with a raw InputStream , call Resources.openRawResource() with the resource ID, which is R.raw.filename . However, if you need access to original file names and file hierarchy, you might consider saving some resources in the directory (instead of res/raw/ ). Files in is not assets/ given a resource ID and so can read them only using AssetManager . |
values/ |
XML files that contain simple values, such as strings, integers, and colors. Whereas XML resource files in and res/ subdirectories define a single resource based on the XML filename, files in the values/directory describe multiple resources. For a file in this directory, each child of the <resources> element defines a single resource. For example, the A <string> element creates an R.string resource and a <color> element creates an R.color resource. Because each resource are defined with their own XML element, you can name the file whatever you want and place different res Ource types in one file. However, for clarity, your might want to place unique resource types in different files. For example, here is some filename conventions for resources you can create in this directory:
- Arrays.xml for resource arrays (typed arrays).
- Colors.xml for color values
- Dimens.xml for dimension values.
- Strings.xml for string values.
- Styles.xml for Styles.
See String Resources, Style Resource, and more Resource Types. |
xml/ |
Arbitrary XML files that can is read at runtime by calling Resources.getXML() . Various XML configuration files must is saved here, such as a searchable configuration. |
Caution: Never save resource files directly inside the res/ directory-it would cause a compiler error.
Understanding property animations and motion tweens:
The essential difference between Android Tween and property animation
An analysis of animation effect of Android development (I.)
Android res/directory under the table