10.5 detailed explanation of Android studio project structure

Time:2021-9-21

The structure of Android project is very complex. Unlike HTML project, the simplest one is to directly an HTML file. I believe students who have learned the previous section will understand that even a HelloWorld project may have dozens of files, so we need to make it clear that we don’t know which directory to put when adding a file.

App - app # a module, similar to a project in eclipse
│♪ build # this module compiles related files
│♪ -- configuration file of build.gradle # this module
│♪ LIBS # dependency correlation, jar
│♪ - proguard-rules.pro # confusion rules file
│   └── src 
│♪ Android test #android test Java source code
│       │   └── java
│       │       └── com
│       │           └── ixuea
│       │               └── course
│       │                   └── helloixuea
│       │                       └── ExampleInstrumentedTest.java
│♪ main # source code, configuration and resource files
│ │♪ - androidmanifest.xml # manifest file, which is used to configure some information of the current project
│ │♪ Java # source code
│       │   │   └── com
│       │   │       └── ixuea
│       │   │           └── course
│       │   │               └── helloixuea
│       │   │                   └── MainActivity.java
│ │ └ - res # resources, including pictures, sounds, videos and other resources
│       │       ├── drawable
│       │       │   └── ic_launcher_background.xml
│       │       ├── drawable-v24
│       │       │   └── ic_launcher_foreground.xml
│       │       ├── layout
│       │       │   └── activity_main.xml
│       │       ├── mipmap-anydpi-v26
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       ├── mipmap-hdpi 
│       │       │   ├── ic_launcher.png
│       │       │   └── ic_launcher_round.png
│ │♪ - MDPI # after mipmap MDPI indicates the resolution of the mobile phone
│       │       │   ├── ic_launcher.png
│       │       │   └── ic_launcher_round.png
│       │       ├── mipmap-xhdpi
│       │       │   ├── ic_launcher.png
│       │       │   └── ic_launcher_round.png
│       │       ├── mipmap-xxhdpi
│       │       │   ├── ic_launcher.png
│       │       │   └── ic_launcher_round.png
│       │       ├── mipmap-xxxhdpi
│       │       │   ├── ic_launcher.png
│       │       │   └── ic_launcher_round.png
│       │       └── values
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│ └ -- Test #java test code
│           └── java
│               └── com
│                   └── ixuea
│                       └── course
│                           └── helloixuea
│                               └── ExampleUnitTest.java
Configuration file of build.gradle # project module
- gradle #gradle configuration directory
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
User defined gradle.properties # custom gradle configuration
Java -- a UNIX system wrapper # for gradle command
Gradlew.bat # is a Windows system wrapper for gradlew commands
File - local.properties # local configuration file
└ -- settings.gradle # the setting file of the current project

This article also providesSupporting videocourse.