Introduction to Android Project Engineering Directory

16049567:

Main project directory:

1. gradle

This folder is the configuration folder of the build tool Gradle, and also stores some project build cache information. When building the project for the first time, these files will be downloaded according to the configuration file. This folder is automatically generated, and we don’t need to care about it The content inside does not need to be manually edited

Two, .idea

This folder is about the configuration folder of AS (copyright, jar package, etc.), this folder is an automatically generated folder, we don't need to care about the content inside, and we don't need to edit it manually

3. app

This is the most important folder for us to develop an application. All codes, resources (including pictures, videos, fonts, third-party resources, etc.) files.

1、build

The file is automatically generated when the project is compiled, no need to care about the content inside

2、libs

The third-party jar and aar package files used in the project, and the jar packages placed in this directory will be automatically added to the build path.

3、src

①androidTest and test

androidTest: This is used to write Android Test test cases, and some automated tests can be performed on the project.

test: This is used to write Unit Test test cases, which is another way to automate testing of projects.

②main

resources and code folder

a、java

This directory is where we put all our Java code

b、res

Store all resource files in the project (pictures, icons, layouts, text)

  • drawable: generally do not place image resources, store some animation files, selector files, graphics configuration files and other xml drawing resource files, image resources are generally placed in other drawable folders, there may be drawable-v24, drawable-hdpi, drawable-mdpi , drawable-xhdpi, drawable-xxhdpi, drawable-xxxhdpi are all used to adapt to screens with different resolutions.
  • layout: Place the layout file, what the page we see in the app we use looks like, almost all are drawn by the xml in this folder.
  • mipmap: generally stores the application startup icon, and other image resources should be placed under the drawable as much as possible. The point nine picture must be placed under the drawable, and an error will be reported if it is placed in the mipmap
  • values: public resources folder, this folder generally contains color resources, text resources, style resources and other folders, and these resources can be called from here to facilitate unified management.
c、AndroidManifest.xml

The configuration file of the entire Android project, all the four major components you define in the program need to be registered in this file, and you can also add permission declarations to the application in this file.

4、.gitignore

This file is used to exclude the specified directory or file in the app module from version control, similar to the outer .gitignore file

5、build.gradle(app)

The gradle build script for the app module

6.proguard-rules.pro

The obfuscation rule file of the project code, in order to prevent the apk file from being cracked by others, the obfuscation code is adopted. Note: obfuscation does not prevent decompilation, but it can make decompiled code more difficult to read.

Four, gradle

gradle is an open source automatic build tool, which can be used as a dependency management and packaging tool for android studio projects, including dependencies and links of tripartite libraries and jar packages, compilation and packaging of resources such as java and res

It can be seen that the gradle folder contains the gradle-wrapper.jar file and the configuration file gradle-wrapper.properties that provide construction support
. This jar package is used to perform related Gradle operations.
gralde-wrapper.properties: This file declares the version and download address of gradle.

When using gradlew to build a project for the first time, Gradle Wrapper will automatically download the gradle version specified by gralde-wrapper.properties.
Gradle Wrapper is a script that calls the declared Gradle version, and we need to download it in advance when compiling . Therefore, developers can quickly start and run the Gradle project, call the pre-declared Gradle version, download it before compiling, and do not need to install it manually, thus saving time and cost. Of course, AndroidStudio will first check whether there is a cached gradle locally. If not, it will automatically download gradle online, so that you don’t need to download gradle first. Of course, if you want to use offline mode, you can also set it yourself: File—Settings—Build, Execution, Deployment—Gradle ,as the picture shows:

5. gitignore

When the project uses git version control, this file is used to configure the directories and files specified by ignoring control, as shown in the following figure:

六、build.gradle

The global gradle build script of the project, here refers to the gradle project automatically compiling the build file, specifying the version of android gradle tools, and the gradle warehouse configuration

七、gradle.properties

This file is a global gradle configuration file, and the properties configured here will affect all gradle compilation scripts in the project. The properties defined in gradle.properties are global and can be directly referenced in the build.gradle of each module. We can make some global configurations of Gradle files in it, and we can also put more private information in it to prevent leakage .

Eight, gradlew and gradlew.bat

These two files are used to execute the gradle command in the command line interface, where gradlew is used in the Linux or Mac system, and gradlew.bat is used in the Windows system.

九、local.properties

Indicates the local paths of the android SDK, NDK, etc., and is generally automatically generated. Unless there is a change, it needs to be modified

十、settings.gradle

The management file of the module introduced in the project

External resource directory:

External Libraries

JDK, SDK version, manually import the version of the third-party library under lib, and remotely depend on the version of the third-party library

Original article, welcome to correct me if there is anything wrong, let's make progress together!

Guess you like

Origin blog.csdn.net/c8296038795/article/details/128106873