An analysis of Android studio directory structure

Source: Internet
Author: User

1190000002963895

At the request of your friends, write this article, let us briefly understand the location and purpose of different directories (files) in Android Studio. First look at the simplest directory structure of the next app

"= = good Complex appearance"

OK, let's see, first, put so many files into such three pieces first.
1. Compiling the system (Gradle)
2. Configuration files
3. Application Module

Gradleis a set Groovy of compiled system scripts recommended by Google (you can also use ant, of course), and the specific introduction and documentation can refer to this portal: https://developer.android.com/tools/building/ Plugin-for-gradle.html
If you learn, the project will be Android compiled at a good understanding (in short, very cool ~), its shortcomings are inefficient, and then because there is the existence of kungfu nets, so the bintray load-dependent will be relatively slow.

The words in the above figure gradle are gradle related to some documents.
The use of Android in Gradle Wrapper Gradle a layer of packaging, I guess the reason for this is because the Gradle update speed is too fast, for the sake of compatibility, just out of this set of plans. (Please correct me if you think there is a problem with this conjecture)
gradlewThe relevant documents are and Gradle Wrapper related. Let's make app a list of files other than folders.

Td>.gitignore
file (folder) name purpose
. Gradle Gra DLE compilation system, version specified by wrapper
. Idea files required by the Android Studio IDE
Buil D where the generated files are stored after compilation
gradle wrapper where the jar and configuration files are located
git ignore file
build.gradle gradle compiled related configuration file (equivalent to makefile) /td>
gradle.properties gradle Related global property settings
gradlew *n Gradle wrapper executable under IX
graldew.bat windows gradle wrapper executable
local.properties Local Property settings (key settings, Android SDK location, etc.), this file is not recommended for uploading to VCs
settings.gradle and setting related Gradle scripts

These are some of the files that are related to external files. Let's look at the files in the more important app modules.

This is the file directory structure under the app module, describes their use

The
file name uses
build compiled text Where the pieces exist (including the resulting apk)
Libs location of dependent libraries ( jar and aar )
src The directory where the source code is located
src/main where the main code is located (src/androidtest) is the test code Location
src/main/assets Some files that are included with Android
Src/main/java Most importantly, where our Java code is located
src/main/jnilibs the default location (. so file) for some of the dynamic libraries in JNI
src/main/res where the Android resource file is located
src/main/androidmanifest.xml androidmanifest no Introduction ~
build.gradle and the project-related gradle configuration, which is equivalent to the makefile of this project, are written in this case for some project dependencies
PROGUARD.P Ro Code obfuscation configuration file

The above is Android Studio a simple introduction to the directory structure ~

An analysis of Android studio directory structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.