First, res directory:
1, properties: Android required;
2, the role: the storage of Android projects of various resource files. These resources will automatically generate R.java.
2.1, Layout: the storage interface file.
2.2, Strings.xml: string resource file;
2.3, Colors.xml: color resource file;
2.4, Dimens.xml: size resource file;
2.5, drawable-ldpi,drawable-mdpi,drawable-hdpi: are small, medium and large size picture files.
3. Use:
3.1. Access to resources:
1, use: @ Resource Class name/resource item name.
2. Use the @id/glyph: The Android component needs to be represented by the ID attribute value in the tag, which is of type int and can only be a value of the resource type, that is, the value represented in the resource file XML, which is parsed with @. such as: @id/abc,@+id/xyz. Where both ABC and XYZ are defined in the resource file. The "@" symbol prompts the XML parser to parse the subsequent string into a glyph. "id" indicates that the glyph will be categorized under "IDs". "@+id/xyz" indicates that an item will be added to the R.java ID inner class as public static final int xyz=0x*****, followed by a hexadecimal value. If XYZ already exists, it is no longer incremented.
Get the component in the program, use Findviewbyid (), get the component in XML, use a resource reference: @id/glyph.
Second, src directory:
1, properties: Android required;
2, Function: Save Java source files;
Iii.. androidmanifest.xml file.
1, properties: Android required;
2, role: The global profile of the Android project, to control the Android app name, icon, access rights and other overall properties.
Iv.. R.java file:
1, Location: Gen directory;
2. Function: A class file automatically generated according to the resource file, similar to the resource dictionary of Android application.
3. Composition:
3.1. Each class of resources corresponds to an inner class of R class.
Android Application Architecture Analysis