TutorialBeginner
Your First Android Studio Project, Explained File by File
Create a new Compose project in Android Studio, run it on an emulator or your phone, and understand every file the template creates for you.

On this page
Opening Android Studio for the first time can feel like walking into a cockpit. Dozens of panels, a project full of files you did not write, and a build system downloading things in the background. The good news: every Android project has the same layout. Learn it once and you can find your way around any project.
In this tutorial you will create a project, run it on a virtual phone and on your own phone, and then take a tour of the files the template creates, so you know which ones you will actually touch.
Before you begin
You need Android Studio installed from the official Android Developers website. Copies from other sites can be outdated or unsafe. Google's install page lists 8 GB of RAM as the minimum and 16 GB if you plan to use the emulator, plus a 64-bit operating system. On Windows and Linux, the emulator also needs hardware virtualisation turned on.
Create the project
- On the Welcome screen, select New Project.
- Under Phone and Tablet, choose Empty Activity, then Next.
- Name it
Hello Android. Android Studio fills in a package name such ascom.example.helloandroid. - Set Minimum SDK to API 24 (Android 7.0), which installs on the vast majority of phones in use. If you are asked for a build configuration language, keep Kotlin DSL.
- Select Finish and wait for Gradle to sync. The first sync can take several minutes while it downloads tools and libraries.
What the template wrote for you
When the sync finishes, Android Studio opens MainActivity.kt. Your version may differ by a line or two.
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge() // draw behind the status and navigation bars
setContent { // everything inside is Compose UI
HelloAndroidTheme { // your app's Material 3 colours and fonts
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
name = "Android",
modifier = Modifier.padding(innerPadding)
)
}
}
}
}
}
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(text = "Hello $name!", modifier = modifier)
}Three ideas are worth spotting straight away:
- The activity is the entry point: Android starts it when someone taps your app's icon.
setContenthands the screen over to Compose.Greetingis a composable function: a small piece of UI described in Kotlin.
Select Split at the top right of the editor to see the code and a live Preview side by side.
Run it
On the emulator
Open Device Manager, create a virtual device (a Pixel phone with a recent system image is a good choice), then pick it in the device list and select the green Run button. The first build is the slowest; after that, runs are much quicker.
If the emulator ever freezes, you do not need to reinstall anything. In Device Manager, Cold Boot restarts the virtual phone from off, and Wipe Data resets it to factory settings.
On your own phone
- On the phone, open Settings → About phone and tap Build number seven times until you see that you are now a developer.
- Open Developer options and turn on USB debugging.
- Connect the phone, allow debugging when asked, choose it in the device list and select Run.
A real phone is often faster than the emulator on a modest computer, and it shows how your app really feels in the hand.
A tour of the project
The Project panel starts in the Android view, which groups files by purpose. These are the ones that matter on day one.
| File or folder | What it holds | Open it to |
|---|---|---|
| manifests/AndroidManifest.xml | The app's ID card for Android: screens, permissions, icon, theme | Add a permission or change the launcher screen |
| kotlin+java/… | Your Kotlin code, including MainActivity.kt and the ui.theme package | Write screens and logic |
| res/ | Resources: text, images, colours, icons | Change text, add images, translate |
| build.gradle.kts (Module :app) | How to build your app: its id, Android versions and libraries | Change minSdk or add a library |
| libs.versions.toml | The version catalog: every library and plugin version in one place | Add or update a dependency |
| settings.gradle.kts | The project's modules and where libraries are downloaded from | Add a module later |
The manifest
Android reads AndroidManifest.xml before anything else. It lists your activities, the permissions you need and your app's icon and theme. The MAIN action and LAUNCHER category on MainActivity are what put your icon in the app drawer. A classic beginner error is loading data from the internet without declaring the permission:
<uses-permission android:name="android.permission.INTERNET" />Resources
Anything that is not code lives in res. Keep your text in res/values/strings.xml rather than typing it into Kotlin: add a translated copy in a folder such as values-es, and phones set to Spanish will show Spanish with no code changes.
Gradle: the builder
Gradle compiles your code, collects resources and libraries, and packages the app. The module's build file says how. Here is a shortened version; your numbers will be newer.
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.example.helloandroid"
defaultConfig {
applicationId = "com.example.helloandroid" // the app's unique id on Google Play
minSdk = 24 // oldest Android version that can install it
versionCode = 1 // goes up with every release
versionName = "1.0" // the version people see
}
buildFeatures { compose = true }
}
dependencies {
implementation(platform(libs.androidx.compose.bom)) // keeps Compose versions in step
implementation(libs.androidx.material3)
}The libs. names come from gradle/libs.versions.toml, the version catalog. Keeping every version in one file means a project with several modules never mixes library versions. After editing a Gradle file, select Sync Now in the bar at the top of the editor.
Your first change
Open res/values/strings.xml, change app_name to "My First App" and run the app again. Find it in the app drawer under its new name. Then change "Android" in MainActivity.kt to your own name and watch the Preview update. Small, safe changes like these are the fastest way to get comfortable.
Where to go next
Once the basics feel familiar, the real productivity gains come from knowing modern Android Studio well: version catalogs, the Compose BOM, KSP, Gemini in Android Studio, and a stock of Kotlin and Compose patterns you can reach for without searching.
That is what Learn Android Studio & Kotlin is for. It is our course for developers who know the basics and want to grow, with copy-ready Kotlin and Jetpack Compose code, complete apps explained file by file, and Android interview questions for every level. Every chapter ends with a Code recipes lesson: Kotlin examples by file, how they work, and real error messages with their fixes. The first three chapters are free.
Completely new to coding? Start with Learn Android App Development instead, which begins from zero.
- #Android Studio
- #Kotlin
- #Jetpack Compose
- #Gradle
Keep reading

Building Apps
How Much Does It Cost to Build an App? A Practical Guide
What actually drives the price of an Android and iPhone app, ballpark ranges by size, the running costs people forget, and how to spend less without cutting corners.
5 min read

Comparison
Flutter vs Native Android and iOS: How to Choose for Your App
One Flutter codebase or separate Kotlin and Swift apps? What each approach is good at, where native still wins, and how we decide for our own apps and for clients.
4 min read

Building Apps
What to Prepare Before Hiring an App Developer: A Checklist
Get better quotes and fewer surprises: the goal, features, examples, budget and accounts to have ready before you hire a developer or studio for your app.
3 min read