[go: up one dir, main page]

0% found this document useful (0 votes)
20 views4 pages

Android App Project Structure-2

The document outlines the structure of an Android app project, detailing the main directories and files such as the app/ directory, project root directory, and gradle/ directory. It describes the purpose of each component, including source code, resources, build configurations, and testing files. Additionally, it mentions the potential for enhancing the project structure with architectural patterns like MVVM or Clean Architecture for improved organization and maintainability.

Uploaded by

Mudasir Bhatti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

Android App Project Structure-2

The document outlines the structure of an Android app project, detailing the main directories and files such as the app/ directory, project root directory, and gradle/ directory. It describes the purpose of each component, including source code, resources, build configurations, and testing files. Additionally, it mentions the potential for enhancing the project structure with architectural patterns like MVVM or Clean Architecture for improved organization and maintainability.

Uploaded by

Mudasir Bhatti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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.

You might also like