Thuta Learning
BasicMobile Developmentintermediate

Android Project Structure

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand Android Project Structure without any of the intimidation
  • Be able to run Android Studio/Compose code yourself
  • Apply this concept immediately in a real project

Let's think about it for a second

`AndroidManifest.xml` is your app's 'ID card' — it declares the app name, permissions (camera, internet), the list of Activities, and the minimum Android version. `build.gradle.kts` (Kotlin DSL) is the file where you define your dependency (library) list and build configuration (compileSdk, minSdk) — to add a new library, this is the file you edit. `MainActivity.kt` is the code entry point that runs first when the app opens.

Let's connect this to a real-world scenario

To add a library (say, Retrofit for networking), write `implementation("com.squareup.retrofit2:retrofit:2.11.0")` inside the `dependencies { }` block in `build.gradle.kts` (app module), then click 'Sync Now' to download and link the library — and in `AndroidManifest.xml`, if you need internet access, add `<uses-permission android:name="android.permission.INTERNET" />`.

Let's look at an example together

kotlin
// app/build.gradle.kts
dependencies {
    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.material3:material3")
    // Add a new library here, then click "Sync Now"
}

// AndroidManifest.xml (excerpt)
// <uses-permission android:name="android.permission.INTERNET" />
// <activity android:name=".MainActivity" android:exported="true" />
You should see
You should be able to distinguish the roles of the three project structure files (Manifest/Gradle/MainActivity).

Try it in 5 minutes

Create a new project in Android Studio, open `AndroidManifest.xml`, `build.gradle.kts`, and `MainActivity.kt`, and write your own notes on what each one does.

A quick word of caution

There are actually two `build.gradle.kts` files per module (root-level and app-level) — dependencies should only be added to the app-level `build.gradle.kts`.

Easy traps

  • Forgetting to add a permission to `AndroidManifest.xml` — a feature (camera, internet) can crash or fail at runtime
  • Forgetting to click 'Sync Now' after editing `build.gradle.kts` — your code won't recognize the new dependency yet and you'll see errors

Now try it yourself

Create a new project in Android Studio, open `AndroidManifest.xml`, `build.gradle.kts`, and `MainActivity.kt`, and write your own notes on what each one does.

You'll know it worked when: You should be able to distinguish the roles of the three project structure files (Manifest/Gradle/MainActivity).

Android Project Structure | Thuta Learning