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
// 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 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`.