Android App Project
Structure
Outcome School
Android App Project Structure
1. app/ Directory
This is the main module of the application. It contains the following
subdirectories and files:
• src/: Contains the source code for the application.
◦ main/: Primary source code and resources.
▪ java/: Contains Java or Kotlin source code files organized
into packages.
▪ res/: Contains all non-code resources.
▪ drawable/: Images, icons, and other drawable assets.
▪ layout/: XML files defining the UI layouts.
▪ values/: XML files for strings, colors, dimensions, styles,
etc.
▪ mipmap/: App Launcher icons in various densities.
▪ anim/: XML files for animations.
▪ assets: Raw files (e.g., fonts, JSON, HTML) included in the
APK, accessible via AssetManager.
▪ AndroidManifest.xml: Defines the app’s components
(activities, services, etc.) and permissions.
◦ test/: Unit tests for the application.
◦ androidTest/: Instrumented tests for the application.
• build.gradle: Contains configurations specific to a module, like
dependencies, SDK versions, and build types.
2. Project Root Directory
Contains configuration files and other modules.
• build.gradle: Configures build settings shared across modules,
including plugin versions and repositories.
• settings.gradle: Lists all modules included in the project.
• gradle.properties: Configuration properties for the Gradle build
system.
• local.properties: Local configuration properties, such as SDK
location.
3. gradle/ Directory
Contains the Gradle wrapper files, which allow building the project with a
specific version of Gradle.
4. Other Common Files and Directories
• .gitignore: Specifies files and directories to be ignored by version
control (e.g., Git).
• proguard-rules.pro: Configuration for code shrinking and
obfuscation.
• libs/: Contains third-party libraries (JAR or AAR files).
5. Extra Files and Directories
• kotlin/: If using Kotlin, source files go in src/main/kotlin/ instead of
java/.
• gradle/libs.versions.toml: (Newer Gradle versions) Centralizes
dependency versions using Version Catalog.
Example Structure
MyApp/
├── app/
│ ├── build.gradle
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ └── com/example/myapp/
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── ...
│ │ │ ├── res/
│ │ │ │ ├── drawable/
│ │ │ │ ├── layout/
│ │ │ │ ├── values/
│ │ │ │ └── ...
│ │ │ ├── assets/
│ │ │ └── AndroidManifest.xml
│ │ ├── test/
│ │ └── androidTest/
│ └── ...
├── build.gradle
├── settings.gradle
├── gradle.properties
├── local.properties
├── gradle/
│ └── wrapper/
└── .gitignore
Note: The above project structure of an Android application provides a
foundation that can be enhanced by adopting architectural patterns like
MVVM (Model-View-ViewModel), MVI (Model-View-Intent), or Clean
Architecture. These patterns improve code organization, testability,
maintainability, and scalability by layering responsibilities over the basic
structure.
Follow Outcome School for
knowledge-packed content.