Thursday, September 19, 2013

Resources

Resource files

Android supports that resources, like images and certain XML configuration files, can be keep separate from the source code.
Resource files must be placed in the /res directory in a predefined sub-folder dependent on their type. You can also append additional qualifiers to the folder name to indicate that the related resources should be used for special configurations. For example you can specify that layout file is only valid for a certain screen size.
The following table give an overview of the supported resources and their standard folder prefix.
Table 4. Resources
Resource Folder Description
Drawables /res/drawables Images (e.g. png or jpeg files) or XML files which describe a drawable.
Simple Values /res/values Used to define strings, colors, dimensions, styles and static arrays of strings or integers via XML files. By convention each type is stored in a separate file, e.g. strings are defined in the res/values/strings.xml file.
Layouts /res/layout XML file with layout description files used to define the user interface for activities and Fragments.
Styles and Themes /res/values Files which define the appearance of your Android application.
Animations /res/animator Define animations in XML for the property animation API which allows to animate arbitrary properties of objects over time.
Raw data /res/raw Arbitrary files to save in their raw form. You access them via an InputStream.
Menus /res/menu Define the properties of entries for a menu.

No comments:

Post a Comment