Res/drawable specifically for PNG, JPG and other icon files. Use Getresources (). Getdrawable (resourceId) in your code to get the resources under this directory.
Res/layout is dedicated to XML interface files, XML interface files and HTML files, mainly used to display the user interface.
The res/values is designed to store the various types of data used by the application. Different types of data are stored in different files, as follows:
· Strings.xml defines strings and values, and uses getresources (). getString (ResourceId) or getresources (). GetText (RESOURCEID) to obtain resources in the activity. Its role is the same as the internationalized resource file in struts.
<? XML version= "1.0" encoding= "UTF-8" ?> < Resources > < name= "Hello">hello</string> </ Resources >
· Arrays.xml defines an array.
<?XML version= "1.0" encoding= "Utf-8"?><Resources> <String-arrayname= "Colors"> <Item>Red</Item> <Item>Yellow</Item> <Item>Green</Item> <Item>Blue</Item> </String-array></Resources>
· Colors.xml defines the color and color string values that you can use in Activity getresources (). Getdrawable (ResourceId) and Getresources (). GetColor ( RESOURCEID) access to these resources. Examples are as follows:
1 <?XML version= "1.0" encoding= "UTF-8"?>2 3 <Resources>4 5 <Colorname= "Contents_text">#ff0000</Color>6 7 </Resources>
· Dimens.xml define dimension Data and use Getresources () in activity. Getdimension (RESOURCEID) access to these resources
<? XML version= "1.0" encoding= "UTF-8" ?> < Resources > < name= "Key_height">50dip</dimen> </resources>
· Styles.xml defines the style.
1 <?XML version= "1.0" encoding= "Utf-8"?>2 3 <Resources>4 5 <stylename= "Itcasttext"Parent= "@style/text">6 7 <Itemname= "Android:textsize">18sp</Item>8 9 <Itemname= "Android:textcolor">#0066FF</Item>Ten One </style> A - </Resources>
res/anim/stores XML files that define animations.
Res/xml/uses Getresources (). GetXML () in the activity to read the XML resource file under this directory.
res/raw/This directory is used to store the original files used by the app, such as sound files. When compiling the software, the data is not compiled and is added directly to the program installation package. In order to use these resources in your program, you can call Getresources (). Openrawresource (ID), parameter ID: r.raw.somefilename.
The Res for Android application architecture