By default, Android Studio displays your project files in the Android view. This view does not reflect the actual file hierarchy on disk, but is organized by modules and file types to simplify navigation between key source files of your project, hiding certain files or directories that are not commonly used. Some of the structural changes compared to the structure on disk include the following:
- Shows all the project's build-related configuration files in a top-level Gradle Script group.
- Shows all manifest files for each module in a module-level group (when you have different manifest files for different product flavors and build types).
- Shows all alternative resource files in a single group, instead of in separate folders per resource qualifier. For example, all density versions of your launcher icon are visible side-by-side.
Within each Android app module, files are shown in the following groups:
- manifests : Contains the AndroidManifest.xml file.
- java : Contains the Java source code files, separated by package names, including JUnit test code.
- res : Contains all non-code resources, such as XML layouts, UI strings, and bitmap images, divided into corresponding sub-directories.
To see the actual file structure of the project including all files hidden from the Android view, select Project from the dropdown at the top of the Project window. When you select Project view, you can see a lot more files and directories. The most important of which are the following:
module-name/
build/ Contains build outputs.
libs/ Contains private libraries.
src/ Contains all code and resource files for the module in the following subdirectories:
androidTest/ Contains code for instrumentation tests that run on an Android device. For more information, see the Android Test documentation.
main/ Contains the "main" sourceset files: the Android code and resources shared by all build variants (files for other build variants reside in sibling directories, such as src/debug/ for the debug build type).
AndroidManifest.xml Describes the nature of the application and each of its components. For more information, see the AndroidManifest.xmldocumentation.
java/ Contains Java code sources.
jni/ Contains native code using the Java Native Interface (JNI). For more information, see the Android NDK documentation.
gen/ Contains the Java files generated by Android Studio, such as your R.java file and interfaces created from AIDL files.
res/ Contains application resources, such as drawable files, layout files, and UI string. See Application Resources for more information.
assets/ Contains file that should be compiled into an .apk file as-is. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. For example, this is a good location for textures and game data.
test/ Contains code for local tests that run on your host JVM.
build.gradle (module) This defines the module-specific build configurations.
build.gradle (project) This defines your build configuration that apply to all modules. This file is integral to the project, so you should maintain them in revision control with all other source code.
For information about other build files, see [Configure Your Build] (https://developer.android.com/studio/build/index.html).