Providing Resources
阅读:http://developer.android.com/guide/topics/resources/providing-resources.html
安卓开发的文件结构及其含义:
Directory | Resource Type |
---|---|
animator/ |
XML files that define property animations. |
anim/ |
XML files that define tween animations. (Property animations can also be saved in this directory, but the animator/ directory is preferred for property animations to distinguish between the two types.) |
color/ |
XML files that define a state list of colors. See Color State List Resource |
drawable/ |
Bitmap files (
See Drawable Resources. |
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 save in their raw form. To open these resources with a raw However, if you need access to original file names and file hierarchy, you might consider saving some resources in the |
values/ |
XML files that contain simple values, such as strings, integers, and colors. Whereas XML resource files in other Because each resource is defined with its own XML element, you can name the file whatever you want and place different resource types in one file. However, for clarity, you might want to place unique resource types in different files. For example, here are some filename conventions for resources you can create in this directory:
See String Resources, Style Resource, and More Resource Types. |
xml/ |
Arbitrary XML files that can be read at runtime by calling Resources.getXML() . Various XML configuration files must be saved here, such as a searchable configuration. |
Caution: Never save resource files directly inside the res/
directory—it will cause a compiler error.
接下来的API指导告诉你该怎么根据机器的变化自动进行适应。一般是:1、先建立不同条件下的资源以及RES下的文件;2、然后把各种资源命名为一模一样;
对于条件一,怎么定义文件夹的名字,在指导页面的表格2有说明。
接下来的指导说明了如何进行详细的操作,有需要可自行参考。