Lesson 3: Understanding the Anatomy of an Android Project
Understanding the Anatomy of an Android Project
Your new project has a lot of generated files. You don't need to understand all of it today, but knowing what's what will save you a lot of confusion.
The important folders
app/
├── src/main/
│ ├── java/com/example/tasklist/ ← your Kotlin code lives here
│ │ └── MainActivity.kt
│ ├── res/ ← images, strings, icons
│ └── AndroidManifest.xml ← describes your app to the OS
└── build.gradle.kts ← dependencies and build configMainActivity.kt — your app's entry point
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
// Your Compose UI goes here
}
}
}When the OS launches your app, this is the first code that runs. setContent { } is where you tell Android what to actually draw on screen — we'll fill this in properly in lesson 6.
AndroidManifest.xml
This file declares what your app needs to work: which screens (Activities) exist, what permissions it requires (camera, internet, etc.), and its name/icon. You'll edit this occasionally — for now, just know it exists and it's where permissions get declared later in the course.
build.gradle.kts — your dependency list
This is where you declare external libraries your app depends on (like the networking and database libraries we'll add later). Every time you add a new library, this is the file you edit, followed by clicking "Sync Now."
The res/ folder
Short for "resources" — this holds anything that isn't code: app icons, string text (for supporting multiple languages later), and colors. We'll use res/values/strings.xml briefly, but Compose handles most UI directly in code rather than in XML.
Next: Lesson 4 — the Kotlin fundamentals this course leans on most.