android-kotlin
/

Android Project Structure – Modules, Gradle & Manifest

Last Sync: Today

On this page

5
0%
5 min read
Remaining
5 minleft

Click any section to jump — progress syncs automatically

android-kotlin

Android Project Structure – Modules, Gradle & Manifest

The Anatomy of an Android Project

An Android project is organized into Modules. A standard project contains at least one 'App' module, but large-scale architectures like Revochamp often split logic into 'Library' modules for networking, AI processing, and UI components. This modularity improves build times and code separation.

  1. The Project-Level Root

The root directory contains configuration files that apply to the entire project, including all modules. For a Technical Lead, the settings.gradle.kts and the root build.gradle.kts are the most critical for managing global dependencies and repository sources (like Maven Central or JitPack).

  • build.gradle.kts (Project): Defines build plugins and versions used across all modules.
  • settings.gradle.kts: Lists all included modules and defines where to find plugins.
  • gradle.properties: Stores project-wide settings like JVM memory limits and AndroidX flags.
  • local.properties: Contains local paths (like the SDK location)—this file should never be committed to Git.

  1. The 'app' Module (The Native Core)

This is where your functional code lives. In a Flutter project, this module contains the MainActivity that boots the Flutter engine.

TEXTRead-only
1
app/
├── build.gradle.kts   # Module-specific build logic (Dependencies, SDK versions)
├── proguard-rules.pro # Code shrinking and obfuscation rules
└── src/
    ├── main/
    │   ├── AndroidManifest.xml # The App's metadata and permissions
    │   ├── kotlin/             # Your Kotlin source code (com.revo.app)
    │   └── res/                # UI Resources (Icons, Strings, Layouts)
    └── test/                   # Unit tests for native logic

  1. AndroidManifest.xml: The System Interface

The Manifest is the 'Source of Truth' for the Android OS. It tells the system which components exist, what permissions the app needs (like Camera or Internet), and which Activity to launch first. For your project, this is where you declare Intent Filters for deep linking into AI templates.

  1. The 'res' (Resources) Folder

Android strictly separates code from static resources. Even in a Flutter app, you must use this folder for native-level assets like the App Icon (mipmap), Launch Screens (drawable), and localized strings (values).

FolderContent TypeArchitectural Importance
drawable/Images/XML vectorsLaunch screens and native UI assets
layout/XML UI definitionsNative views (not used by Flutter UI)
mipmap/App launcher iconsStandardized icons for all device densities
values/Strings, Colors, StylesLocalization and theme constants
xml/Config filesNetwork security and accessibility configs

Test Your Knowledge

Q1
of 3

Which file is used to declare app permissions and components like Activities?

A
build.gradle.kts
B
AndroidManifest.xml
C
settings.gradle.kts
D
res/values/strings.xml
Q2
of 3

In which folder would you place the app's launcher icons for different screen densities?

A
drawable/
B
values/
C
mipmap/
D
raw/
Q3
of 3

What is the primary purpose of the 'settings.gradle.kts' file?

A
To define app versioning
B
To include and manage modules within the project
C
To store API keys
D
To configure the Kotlin compiler

Frequently Asked Questions

What is the difference between build.gradle and build.gradle.kts?

'.gradle' uses Groovy, while '.gradle.kts' uses Kotlin. The Kotlin DSL (KTS) is now the industry standard because it provides type safety, better auto-completion in Android Studio, and a more consistent experience for Kotlin developers.

Where do I add native Android dependencies?

Dependencies are added in the 'dependencies' block of the module-level 'build.gradle.kts'. For example: implementation('com.google.ai:generative-ai:1.0.0').

What is the 'R' class in Android?

The R class is an autogenerated Java class that contains IDs for all resources in your 'res' folder. It allows you to reference resources in Kotlin code, e.g., 'R.string.app_name' or 'R.drawable.launch_bg'.

Previous

android introduction

Next

android manifest

Related Content

Need help?

Explore our comprehensive docs or start a chat with our tech experts.