APP directory structure introduced under AndroidStudio

【turn】

Project Name: Project Name 
Application Name: Application currently issued after the name, such as QQ icon below the name of "QQ", is the Application Name.

Android Studio project directory

Write pictures described here 
1, .gradle and .idea 
placed under the two directories are automatically generated Android Studio files, we do not care about, is not going to be edited manually. 
2, app 
content item code, and other resources are almost always placed in this directory, we are also behind the development work carried out basically in this directory, this directory will be launched a little later alone to explain. 
3, build 
this directory you do not need too much care, which mainly contains some automatically generated at compile time file. 
4, gradle 
This directory contains under gradle wrapper configuration file, use gradle wrapper way ahead will not need to download gradle good, but will need an Internet connection to download automatically determines whether the local cache gradle according to the situation. Android Studio is not enabled by default gradle wrapper, if necessary open, you can click on Android Studio navigation bar -> File -> Settings -> Build, Execution, Deployment -> Gradle, make configuration changes. 
5, .gitignore 
This file is used to specify the directories or files to exclude version control. 
6, build.gradle 
This is a global project of gradle build scripts, usually the contents of the file is not required to modify. A detailed analysis of the specific content of gradle build script below back. 
7, gradle.properties 
this document is global gradle configuration file, where the configuration of the property will affect all gradle build script project. 
8, gradlew and gradlew.bat 
These two documents are used to perform gradle the command line interface, which is used in gradlew Linux or Mac systems, gradlew.bat is used in Windows systems. 
9, HelloWorld.iml 
IML IntelliJ IDEA project files are all automatically generate a file (Android Studio is developed based on IntelliJ IDEA), which is used to identify a IntelliJ IDEA project, we do not need to modify any of the contents of this file. 
10, local.properties 
this file is used to specify the path Android SDK this machine, the content is usually generated automatically, we do not need to be modified. Android SDK unless you position the machine has changed, then it will change the path of this file in the new location. 
11, settings.gradle 
This file is used to specify the project in all modules introduced. Because HelloWorld project in only one app module, so the introduction of the document, there is only this one app module. The introduction of modules is done automatically under normal circumstances, we need to manually modify this file scenario may be less.

app directory structure

In addition to the app directory, most of the files and directories are automatically generated we do not need to be modified, below we detail app directory structure. 
Write pictures described here 
1, build 
directory and build directory similar to the outer layer, but also contains some major auto-generated file at compile time, but inside it's content will be more and more complex, we do not have much relationship. 
2, libs 
if your project to use third-party jar package, you need to put these packages are placed in the jar libs directory, put the jar package in this directory will be automatically added to the build path to go. 
3, src / AndroidTest 
here is used to write Android Test test case, you can do some automated testing project. 
4, src / main / java 
no doubt, java catalog is to place all the places we java code, expand the directory, you will see HelloWorldActivity file we just created on the inside. 
5, src / main / res 
content in this directory a bit more. Simply put, it is that you use in the project to all the pictures, layout, strings and other resources must be stored in this directory. Of course, there are many subdirectories in this directory, the picture on the drawable directory, directory layout on the layout, the string values placed in the directory, so you will not worry about the whole res directory confused mess. 
6, main / AndroidManifest.xml 
This is your overall Android project configuration file, you define in the program so that the four components need to be registered in this file, you can also add permissions to the application statement in this document. 
7, test 
here is used to write Unit Test test case, the project is another way to automate testing. 
. 8, .gitignore 
This file is used to specify the directory or file in the app exclude version control module, and an outer layer of a similar role .gitignore file. 
9, app.iml 
IntelliJ IDEA project is automatically generated files, we do not care or modify the contents of this file. 
10, build.gradle 
this is gradle app modules build scripts, this file will be designated to build a lot of projects related configuration. 
11, proguard-rules.pro 
This file is used to confuse the rules specified item code, when the code is developed labeled as installation package file, if you do not want others to crack the code, the code will usually confused, so that the attacker difficult to read.

Resources in the project

Expand res directory look, in fact, there is still a lot of things, it is easy to see dazzling, as follows: 
Write pictures described here 
at the beginning of the drawable folders are used to put a picture; 
at the beginning of the file folders are used mipmap put the application icon; 
the file to the beginning of the clip values are used to put a string, style, color, and other configurations; 
layout folder layout is used to put the file.

Guess you like

Origin www.cnblogs.com/eggtomcato/p/11077921.html