Written in the previous words:
1. Recently in self-study Android, is also reading while writing some demo, because of more and more knowledge points, the brain is more and more memory is not clear, so intends to write reading notes, for later review, but also to learn what they understand to write out, caught dead, if there is a wrong place, I hope everyone give and correct.
2. Because similar to reading notes, may format God horse will compare with (hen) meaning (chou), we can't stand, you can hard spit groove.
I'm just dividing the line ***************************************
Think for a long time, do not know the first article should record what, say some of the project after the creation of the directory structure of the description of it.
Let's look at the directory structure of the demo I wrote myself:
The current directory is intercepted from Android studio, the selected view mode is "Project Files", different view modes see a slightly different directory structure, but not much difference.
1. The "2-java folder" Java source file is similar to a normal Java project.
2. The "3-res folder" Resource Directory folder, which contains several subdirectories.
"3.1-drawable folder" where hdpi, ldpi, mdpi and so on refers to the different resolutions of the device, such as drawable-hdpi folder placed for high-resolution devices to use the Drawable object, is a variety of picture resources;
The layout file of the "3.2-layout folder" App interface, where each interface (Activity) of the app corresponds to an XML layout file in the Layout folder to control the location, style, etc. of the elements (such as buttons, text boxes, etc.) displayed by the Activity.
The menu layout file of the "3.3-menu folder" App interface, the app's Interface (Activity), if it includes a menu (similar to the Windows right-click menu), then the menu layout file will be placed in this folder;
The "3.4-raw folder" is used to store some audio files.
The "3.5-values folder" series of resources for a variety of XML files, such as the defined string file Strings.xml, defines the various controls such as size Dimens.xml, defines the color of the color.xml, and so on.
3. "4-androidmanifest.xml" Each project must have the file, and under the root directory, the file name is fixed. This file declares all the components so that they can be used normally, and it is useful.
4. "1-r.java file"
The file is an index file for all resource files (res folders) in the project, which is automatically generated by the system and cannot be modified manually. For example, if you want to find a button in your activity (the layout file has a name of a), Then in the code can be directly written r.id.a; If you want to find your own custom string B, color value C, a control size D, and so on, then the code can be directly written r.string.b,r.color.c, R.DIMEN.D;
The directory structure is roughly the same, some of the other documents I am not very clear about the usefulness, some useful, follow-up supplement.
"Please enlighten us, thank you!" 】
Android Basic Learning First-project directory structure