In the previous tutorial, we created our first Android application using Kotlin and Jetpack Compose.
Android Studio automatically generated several folders and files for us.
If you’re new to Android development, names such as app, manifests, java, kotlin, res, build.gradle.kts, minSdk, and targetSdk can initially look confusing.
In this tutorial, we’ll understand the Android Studio project structure step by step and learn what the most important files and folders are used for.
You don’t need to memorize everything immediately. The goal is to understand where the important parts of an Android application live.
What You’ll Learn
In this tutorial, we’ll cover:
- Android Studio project structure
- Project and app modules
MainActivity.kt- Kotlin source files
AndroidManifest.xml- Resources folder
- Drawable resources
- App icons
- String resources
- Theme resources
- Gradle build files
- Dependencies
namespaceapplicationIdminSdktargetSdkcompileSdk
Let’s start by looking at the overall structure.
Android Studio Project Structure
A simple Android project may conceptually look like this:
MyFirstApp
│
├── app
│ ├── manifests
│ │ └── AndroidManifest.xml
│ │
│ ├── kotlin + java
│ │ └── com.example.myfirstapp
│ │ ├── MainActivity.kt
│ │ └── ui.theme
│ │
│ ├── res
│ │ ├── drawable
│ │ ├── mipmap
│ │ ├── values
│ │ └── xml
│ │
│ └── build.gradle.kts
│
├── Gradle Scripts
│
└── settings.gradle.kts
The exact files displayed can vary depending on your Android Studio version, project template, and project configuration.
Don’t worry if your project doesn’t look exactly the same.
What is a Module?
Android projects are organized into modules.
When we created our first application, Android Studio created a module called:
app
The app module contains the main Android application.
You can think of it like this:
Android Project
↓
app module
↓
Application code + resources + configuration
Small applications may contain only one app module.
Larger Android projects can contain multiple modules.
For example:
MyApp
│
├── app
├── core
├── data
├── domain
├── feature-home
└── feature-profile
Multi-module architecture is an advanced topic that we’ll cover much later.
For now, we’ll work mainly inside the app module.
Understanding the app Module
Expand the app module in Android Studio.
You’ll see several important sections.
Typically, these include:
manifests
kotlin + java
res
Each has a different responsibility.
The Kotlin Source Folder
The Kotlin source section contains our application’s Kotlin code.
For our example project, you may see something similar to:
com.example.myfirstapp
Inside this package, you’ll find:
MainActivity.kt
This is the file we worked with in the previous tutorial.
What is MainActivity.kt?
MainActivity.kt contains our application’s main Activity.
A simplified example looks like:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MyFirstAppTheme {
WelcomeScreen()
}
}
}
}
The Activity acts as an entry point for displaying our application UI.
Our flow looks like:
MainActivity
↓
onCreate()
↓
setContent()
↓
Jetpack Compose UI
We’ll explore the Android Activity lifecycle in a dedicated tutorial.
What is a Package?
Our Kotlin files live inside a package.
For example:
com.example.myfirstapp
Packages help organize code and prevent naming conflicts.
As our application grows, we might organize our code into packages such as:
com.example.myfirstapp
├── ui
├── data
├── domain
├── navigation
└── utils
Later, when we learn architecture, we’ll organize our application more professionally.
Understanding the ui.theme Package
A Compose project usually contains a theme package.
You may see files such as:
Color.kt
Theme.kt
Type.kt
These files define the visual theme of your application.
For example:
ui.theme
│
├── Color.kt
├── Theme.kt
└── Type.kt
They can control things such as:
- Colors
- Typography
- Light theme
- Dark theme
- Material Design configuration
We’ll learn how to customize Material 3 themes later in the Jetpack Compose series.
AndroidManifest.xml
Another important file is:
AndroidManifest.xml
You’ll find it under the manifest section of the app module.
The Android Manifest provides important information about your application to the Android system.
A simplified manifest might look like:
<manifest>
<application>
<activity
android:name=".MainActivity"
android:exported="true">
</activity>
</application>
</manifest>
The actual generated manifest will contain additional configuration.
What is AndroidManifest.xml Used For?
The manifest can declare important application components and configuration, including:
- Activities
- Services
- Broadcast Receivers
- Content Providers
- Permissions
- Application configuration
- Intent filters
For example, if an application needs internet access, it can declare:
<uses-permission android:name="android.permission.INTERNET" />
Don’t start adding permissions unnecessarily.
Android permissions have important privacy and Google Play policy implications, which we’ll cover in dedicated tutorials.
Understanding the res Folder
res stands for resources.
This folder contains non-code resources used by the Android application.
You may see folders such as:
res
│
├── drawable
├── mipmap
├── values
└── xml
Let’s understand the important ones.
drawable
The drawable folder is commonly used for graphical resources.
Depending on the project, it can contain things such as:
- Vector drawables
- Shape resources
- XML drawables
- Images
Example:
res
└── drawable
├── background.xml
└── app_banner.png
Jetpack Compose can also access Android drawable resources.
mipmap
The mipmap directories are commonly used for launcher icon resources.
You may see folders such as:
mipmap-hdpi
mipmap-mdpi
mipmap-xhdpi
mipmap-xxhdpi
mipmap-xxxhdpi
These represent different screen densities.
Android can choose an appropriate resource based on the device.
You don’t need to manually understand every density yet.
We’ll cover Android resources and screen densities later.
values
The values directory contains XML resource values.
Depending on your project, you may see files such as:
strings.xml
colors.xml
themes.xml
Not every Compose project will have exactly the same files.
strings.xml
Instead of hardcoding every user-facing string directly in Kotlin, Android applications can store text in string resources.
For example:
<resources>
<string name="app_name">My First App</string>
</resources>
We can then access the string from Compose.
For example:
Text(
text = stringResource(R.string.app_name)
)
Using string resources becomes particularly important when supporting multiple languages.
Why Use Resources?
Resources allow us to separate application content from application logic.
Instead of placing everything directly inside Kotlin files, Android provides a structured resource system.
For example:
Kotlin Code
↓
Business/UI logic
Resources
↓
Strings
Images
Icons
Themes
Other configuration
This makes applications easier to maintain and localize.
What is Gradle?
Now let’s look at one of the parts that often confuses new Android developers:
Gradle
Gradle is the build system used by Android projects.
It helps Android Studio:
- Compile source code
- Manage dependencies
- Configure builds
- Create APKs
- Create Android App Bundles
- Manage debug and release variants
You don’t need to understand all of Gradle immediately.
We’ll gradually learn the parts we actually use.
Project-Level and Module-Level Configuration
Android projects can contain Gradle configuration at different levels.
A simplified structure might look like:
MyFirstApp
│
├── build.gradle.kts
│
├── settings.gradle.kts
│
└── app
└── build.gradle.kts
One of the files you’ll frequently edit is the module-level file:
app/build.gradle.kts
What is build.gradle.kts?
Modern Android projects commonly use Kotlin-based Gradle build scripts with the .kts extension.
Inside the app module’s build configuration, you may see something conceptually similar to:
android {
namespace = "com.example.myfirstapp"
compileSdk = ...
defaultConfig {
applicationId = "com.example.myfirstapp"
minSdk = ...
targetSdk = ...
versionCode = 1
versionName = "1.0"
}
}
The actual values depend on the project and Android Studio version.
Let’s understand the important properties.
What is namespace?
The namespace is used for your application’s generated Android classes and resource references.
Example:
namespace = "com.example.myfirstapp"
For beginners, it may look similar to the application’s package name.
Later, we’ll understand the differences between namespaces, packages, and application IDs.
What is applicationId?
The applicationId uniquely identifies your Android application when it is installed and distributed.
Example:
applicationId = "com.example.myfirstapp"
For a real application, you might use something such as:
com.companyname.appname
The application ID is particularly important when publishing an application to Google Play.
Choose production application IDs carefully.
What is minSdk?
minSdk defines the minimum Android API level your application supports.
Conceptually:
minSdk
↓
Oldest Android API level supported by the app
If a device runs an Android version below your application’s minimum supported API level, the application cannot normally be installed on that device.
What is targetSdk?
targetSdk tells Android which API level your application is designed and tested to target.
Conceptually:
targetSdk
↓
Android behavior level your app targets
Target SDK is important because Android platform behavior and Google Play requirements evolve over time.
We’ll discuss SDK versions in much more detail in a dedicated article.
What is compileSdk?
compileSdk determines which Android API level is available when compiling your application.
Conceptually:
compileSdk
↓
APIs available while compiling the app
A simplified comparison is:
minSdk
↓
Oldest API level your app supports
targetSdk
↓
API level your app is designed to target
compileSdk
↓
API level used to compile the app
These three values are related but serve different purposes.
versionCode and versionName
You’ll also encounter:
versionCode = 1
versionName = "1.0"
versionCode
versionCode is an integer used to identify different versions of your application.
For example:
Version 1 → versionCode 1
Version 2 → versionCode 2
Version 3 → versionCode 3
When publishing updates, the version code needs to increase.
versionName
versionName is the user-facing version label.
For example:
1.0
1.1
2.0
You might therefore have:
versionCode = 5
versionName = "1.2"
We’ll discuss app versioning when we prepare an application for Google Play.
What are Dependencies?
Android applications rely on libraries.
These libraries are added as dependencies.
Inside the app module’s Gradle configuration, you’ll find a dependencies section.
Conceptually:
dependencies {
// Android libraries
// Compose libraries
// Testing libraries
}
As we progress through the series, we’ll add libraries for technologies such as:
Navigation
Room
Hilt
Retrofit
Coroutines
Testing
Gradle downloads and makes those libraries available to our application.
What is settings.gradle.kts?
Another project file is:
settings.gradle.kts
This file helps Gradle understand the overall project structure.
For example, it can define which modules belong to the project.
A simple project may contain:
:app
Later, a multi-module application could contain:
:app
:core
:data
:domain
:feature:home
For now, you usually won’t need to modify this file often.
Android View vs Project View
Android Studio can display project files in different ways.
The Android view simplifies the project structure and groups related Android files together.
A more general Project view shows a structure closer to the actual files and directories on disk.
This is why the same project can appear slightly different depending on the selected project view.
For beginners, the Android-oriented view is usually easier to navigate.
Files You’ll Use Frequently
At the beginning of your Android journey, you’ll spend most of your time working with a relatively small set of files.
For example:
MainActivity.kt
↓
Compose UI and Activity
ui.theme
↓
Application theme
AndroidManifest.xml
↓
Application configuration
res/
↓
Resources
app/build.gradle.kts
↓
Build configuration and dependencies
As the application grows, we’ll introduce additional packages and files.
Don’t Try to Memorize Everything
Android projects can look complicated when you first open them.
You don’t need to memorize every folder.
Start with these five concepts:
1. Kotlin files → Application code
2. AndroidManifest.xml → Application configuration
3. res → Application resources
4. build.gradle.kts → Build configuration
5. app module → Main Android application
Once these are clear, the rest of the project structure becomes much easier to understand.
Common Beginner Mistakes
Editing Generated Files Without Understanding Them
Some files are generated automatically by Android or Gradle.
Avoid randomly modifying generated files just to fix an error.
Understand what the file does first.
Adding Dependencies Everywhere
Dependencies should be added to the appropriate Gradle configuration.
Don’t copy random dependency snippets from old tutorials without checking whether they’re still appropriate for your project.
Hardcoding Every String
Instead of putting every user-facing string directly inside Kotlin code, consider using string resources when appropriate.
This becomes especially useful for localization.
Changing applicationId Carelessly
The applicationId is important for installed applications and Google Play distribution.
For production applications, plan it carefully.
Quick Project Structure Summary
Here’s a simplified reference:
app/
│
├── manifests/
│ └── AndroidManifest.xml
│ → App configuration
│
├── kotlin + java/
│ └── MainActivity.kt
│ → Kotlin application code
│
├── res/
│ ├── drawable/
│ │ → Images and drawable resources
│ │
│ ├── mipmap/
│ │ → Launcher icons
│ │
│ └── values/
│ → Strings and other values
│
└── build.gradle.kts
→ App build configuration
and dependencies
You can return to this reference whenever you get confused about where something belongs.
What We’ve Learned
In this tutorial, we learned about:
- Android Studio project structure
- Modules
- The
appmodule - Kotlin source files
- Packages
MainActivity.kt- Compose theme files
AndroidManifest.xml- Android resources
drawablemipmapvalues- Gradle
build.gradle.kts- Dependencies
namespaceapplicationIdminSdktargetSdkcompileSdkversionCodeversionName
You now have a much better understanding of the files Android Studio created for your application.
What’s Next?
Now that we understand the basic Android project structure, the next step is to understand some of the most important Android configuration concepts in more detail.
Next Tutorial
Android SDK, API Level, minSdk, targetSdk & compileSdk Explained
We’ll learn exactly what each SDK value means, how they differ, how they affect device compatibility, and why they matter when publishing applications to Google Play.
Happy Coding!
Continue learning modern Android development with Moiks Developer Blog.