Table of Contents
Understanding the Android Studio Project Structure
When you create a new Android app in Android Studio, the IDE generates many files and folders for you. At first this can look confusing. In this chapter you will learn what you are seeing in the Android Studio window, what the main parts are for, and how to mentally organize a typical Android project. You will focus on the overall structure and the main regions of the project, not the detailed contents of each file or of Gradle, which have their own chapters.
Project View vs File System
Android Studio shows your project through different views. The most useful one for beginners is the Android view, which is selected in the Project tool window on the left side. This view does not show every folder exactly as it exists on disk. Instead, it groups files by their role in an Android app. For example, all your code appears under java, and all your layout files appear under res/layout, even if there are some internal differences in the actual file system.
If you switch the view from Android to Project or Project Files, you will see the true file system layout, including additional folders like .idea and .gradle. As a beginner, you can mostly stay in the Android view, because it matches how Android Studio expects you to think about your application structure.
The top level of your project usually contains several modules. Most beginner projects have a single main module called app. Everything related to your application code, resources, and app level configuration lives in this module.
The App Module
The app module represents your Android application. In the Android view you will see it as a node named app with several subnodes. This is the part you will work with most of the time.
Inside the app module, the most important elements for you are the manifests, java, and res sections, and the Gradle build script for the module. The manifests section contains AndroidManifest.xml, which will be covered in its own chapter. The java section contains your Kotlin and Java source code, including activities, fragments, and other classes. The res section contains your resources such as layouts, images, strings, and colors, which you will learn in detail when you study resource directories.
When you build or run the app, Android Studio takes everything in this app module, combines it with libraries and the Android SDK, and produces an APK or AAB file. The app module is therefore the main building block that becomes your installable application.
Source Code Directories
Inside the app module, under the java node, Android Studio shows three groups that often look like this: your application package, another folder with .androidTest, and another with .test. These represent different source sets. The main source set holds the application code, while the others hold test code. Testing itself is a separate topic, so here you only need to recognize that these folders exist and are not part of your main app logic.
The main application code lives in app/src/main/java/<your/package/name> for Java code and app/src/main/java or app/src/main/kotlin for Kotlin code, depending on project setup. In the Android view, Kotlin files appear in the java section as well, so do not be confused by the name. Android Studio treats both languages as part of the same logical code area.
Inside the main package folder, you will typically find files such as MainActivity.kt. This is where your activities, fragments, view models, and other classes will be saved. You can organize code into subpackages if your project grows, but for a simple beginner app you will usually keep only a few files at this level.
Resource Directories Overview
The res folder inside the app module is where all non code resources live. In the Android view it is shown as res with several subfolders, such as layout, drawable, mipmap, and values. Each subfolder has a specific purpose and follows particular naming rules, which you will explore fully in the chapter about resource directories.
For now, you should recognize resources as separate from code. Layout XML files like activity_main.xml live in the layout folder. Launch icons live in mipmap folders. Strings, colors, and styles live in values XML files. When you edit your user interface, you usually work with XML files from the layout folder together with code in your activities found in the java node.
Android Studio also uses different resource folders to support different device configurations, such as screen size or language. In the Android view, these are grouped under the same type. For example, layout and layout-land both appear under the layout section. This grouping helps you focus on the logical type rather than the physical path.
Manifest Section
The manifests section in the Android view normally contains one main file called AndroidManifest.xml. This file is located in app/src/main/AndroidManifest.xml and serves as a central description of your application for the Android system.
You will learn details of the manifest in its dedicated chapter, including how activities are declared and how permissions are requested. For this overview it is enough to understand that the manifest belongs to the app module and defines essential information about your app that the system reads before running it.
Gradle Scripts in the Project
At the bottom of the Project tool window, still in Android view, you will see a Gradle Scripts section. Inside it there are several files, such as the project level build.gradle or settings.gradle, and the module level build.gradle for the app module. There is also a gradle.properties file and sometimes local.properties.
These files control how your project is built, which SDK version it targets, and which libraries it uses. They are written in a special configuration language that Gradle understands. You will get a deeper understanding of these in the Gradle Build System chapter. For now you mainly need to know where these files are located and that they are part of the project structure, not part of your application logic.
When you change something significant in these files, Android Studio usually asks you to sync the project. This allows Gradle to re read the configuration and prepare the project again.
Generated Files and the Build Folder
Android Studio and the Gradle build system generate many files behind the scenes when you build or run your project. These generated files live mostly in a build directory, such as app/build. In the Android view this folder is often hidden to keep the project view clean.
These generated files can include compiled classes, packaged resources, and intermediate artifacts that are used to create the final APK or AAB. As a beginner, you do not need to open or edit anything in these build folders. If your project behaves strangely after changing Gradle or resources, you sometimes need to perform a clean and rebuild, which clears and regenerates these build artifacts.
Another important generated artifact is the R class, which maps resource names to integer IDs, but this is handled automatically, so you will interact with it only indirectly through code.
Module Hierarchy vs Package Hierarchy
It is important to distinguish between modules and packages. A module, such as app, is a build unit in your project. A package is a logical namespace for your code inside the java or kotlin source folders.
In the Android view you will see your package structure under the java node. For example, if your package name is com.example.myfirstapp, Android Studio will show this as a nested structure. This package name is also used in the manifest and in your Gradle configuration, but the package hierarchy is separate from the module structure.
You can have multiple packages inside a single module and, in more advanced projects, multiple modules inside one project. For now, with one app module, you can think of the module as the container for everything, and the packages as folders inside the java section to help organize your source code files.
Key Areas You Will Use Frequently
When you work on your first apps, you will mainly interact with a small part of the project structure. You will open and edit activities and other Kotlin files in the java node of the app module. You will design user interfaces in XML files inside the res/layout folder. You will adjust strings, colors, and styles inside res/values. Occasionally you will add permissions or declare new activities in AndroidManifest.xml. When you add dependencies or change SDK versions, you will touch the build.gradle file for the app module.
Everything else in the project structure exists to support these core tasks and to allow Gradle and Android Studio to build, run, and package your app correctly.
You should only edit files in the app module that you understand, such as code under java, resources under res, and specific configuration files like AndroidManifest.xml and build.gradle for the module. Avoid changing or deleting generated files or folders inside build, or hidden configuration directories, because these are managed by Android Studio and Gradle.
Navigating the Project in Android Studio
As you practice, become comfortable switching between code and resources. You can open the Project tool window, choose the Android view, then expand the app module. From there, expand java to open Kotlin files, and expand res to open layout or values XML files. Double clicking any file opens it in the editor, sometimes with a split view for design and code when working with layouts.
You can also use the Recent Files shortcut and the search features of Android Studio, but the basic navigation through the app module and its subnodes will always follow the same structure you have learned in this overview. Understanding this structure makes it easier to follow tutorials, read documentation, and cooperate with other developers who expect this common organization in Android projects.