1.Resource class
Resources getresources (): Contextwrapper, obtaining the current resources class
You can manipulate any resource file under the Res/folder.
Catalog: res/anim/
XML file for animation object
Catalog: res/drawalbe/
Picture file
Catalog: res/laout/
Layout file
Catalog: res/menu/
menu XML file that can generate menus
Catalog: res/values/
Array.xml: Defining Array Data
Colors.xml: Defines a string value for color drawalbe and colors. Get the resource using resources.getdrawable () and Resources.getcolor ()
Dimens.xml: Defines the dimension value (dimension). Resources.getdimension ()
Strings.xml: Defines string values, resources.getstring () and Resources.gettext ();
Styles.xml: Defines a Style object.
Catalog: res/xml/
Arbitrary XML files can be obtained at run time through the research Resources.getxml () method.
Catalog: res/raw/
You can copy any file directly to the device, usually a sound file. Resources.openrawresources (). The parameter is the ID of the resource.
2. In addition to the resource class to get a reference to a resource
In a Java file: r.xx.xxx or android.r.xx.xx reference resource
In the XML file: @xx/xx or @android:xx/xxx
3. Resource adaptation
In order to adapt the resources to different models, and user requirements (Chinese users, English users).
The "Res/values-zh" method represents a resource reference for a specific (zh: Chinese), and "-xxx" is a string added to the resource path that describes the specific condition of the resource.
Android-resource Introduction