You've learned Kotlin syntax. Now you need somewhere to actually write it. Android Studio is Google's official IDE for Android development — and it's free, powerful, and a little overwhelming the first time you open it.
This step walks you through the full setup: downloading and installing Android Studio, creating your first project with the right settings, understanding what all the files do, enabling ViewBinding, and running your app on an emulator. By the end you'll have a working Android project on your screen ready for Step 3.
Why Android Studio?
Android Studio is built specifically for Android — it's not a generic IDE with Android plugins bolted on. It gives you:
- Layout Editor — drag and drop UI design with live preview
- Logcat — real-time logs from your app and device
- Profiler — CPU, memory, and network usage in real time
- Emulator — run any Android device configuration without physical hardware
- Kotlin-first — built-in Kotlin support, code completion, refactoring
- Gradle integration — build system that handles dependencies automatically
System Requirements Before You Download
| Minimum | Recommended | |
|---|---|---|
| RAM | 8 GB | 16 GB |
| Disk space | 8 GB | 16 GB (SSD) |
| Screen | 1280 × 800 | 1920 × 1080 |
| OS | Windows 10, macOS 10.14, Ubuntu 20.04 | Latest version of each |
| Java | JDK 17+ | Bundled with Android Studio — no separate install needed |
Step 1 — Download and Install Android Studio
Download
- Go to developer.android.com/studio
- Click Download Android Studio — it auto-detects your OS
- Accept the terms and conditions and download
Install
Windows:
- Run the downloaded
.exeinstaller - Check "Android Virtual Device" when prompted — this installs the emulator
- Accept default install location
- Launch Android Studio from the Start menu
macOS:
- Open the downloaded
.dmgfile - Drag Android Studio into your Applications folder
- Launch from Applications or Spotlight
- If macOS blocks it: System Preferences → Security → Open Anyway
Linux:
- Unpack the downloaded
.tar.gzto your preferred location - Navigate to
android-studio/bin/ - Run
./studio.shto launch
First Launch Setup Wizard
On first launch Android Studio runs a setup wizard:
- Select Standard installation type
- Choose a UI theme (Darcula for dark, IntelliJ for light)
- Let it download the Android SDK — this takes a few minutes
- Click Finish
Step 2 — Create Your First Project
New Project Settings
- From the Welcome screen click New Project
- Select Empty Views Activity — the simplest starting template
- Click Next and fill in:
- Name:
MyFirstApp - Package Name:
com.yourname.myfirstapp - Save Location: a folder you'll remember
- Language: Kotlin
- Minimum SDK: API 26 (Android 8.0)
- Name:
- Click Finish
Step 3 — Understanding the Project Structure
Android Studio opens your new project with a lot of files. Here's what actually matters for a beginner:
MyFirstApp/ ├── app/ │ ├── src/ │ │ └── main/ │ │ ├── java/com/yourname/myfirstapp/ │ │ │ └── MainActivity.kt ← Your first Activity │ │ ├── res/ │ │ │ ├── layout/ │ │ │ │ └── activity_main.xml ← Your first screen layout │ │ │ ├── values/ │ │ │ │ ├── strings.xml ← Text strings │ │ │ │ └── themes.xml ← App colors and style │ │ │ └── drawable/ ← Images and icons │ │ └── AndroidManifest.xml ← App configuration │ └── build.gradle.kts ← App dependencies └── build.gradle.kts ← Project-level build config
The Three Files You'll Touch Most
MainActivity.kt — the Kotlin code for your first screen:
package com.yourname.myfirstapp
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
activity_main.xml — the layout that defines what the screen looks like. Open it in Android Studio and you'll see a visual editor on the right and XML on the left.
AndroidManifest.xml — the app's ID card. Registers every Activity, declares permissions, and sets the launch screen.
Step 4 — Enable ViewBinding (Do This Now)
ViewBinding is how modern Android code accesses views safely — no findViewById(), no null crashes. Enable it now before writing any code, because every post in this series uses it - starting with Step 3: Activities, Layouts and Views.
Open app/build.gradle.kts and add inside the android { } block:
android {
// ... existing config
buildFeatures {
viewBinding = true
}
}
Click Sync Now in the yellow banner that appears. Then update MainActivity.kt to use ViewBinding:
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
// Now access views safely — no findViewById needed
// binding.tvHello.text = "Hello from ViewBinding!"
}
}
findViewById() returns null if you mistype the ID — a crash at runtime. ViewBinding generates a type-safe class from your layout — if you mistype, it's a compile error you catch before running. All code in this series uses ViewBinding.
Step 5 — Set Up an Emulator
- Go to Tools → Device Manager
- Click Create Device (or the + icon)
- Select a hardware profile — Pixel 6 is a good choice
- Click Next → select a system image — choose the latest API 35 (download if needed)
- Click Finish
Run Your App
- Press the green ▶ Run button (or Shift + F10 on Windows / Ctrl + R on Mac)
- Select your emulator from the list
- Wait for it to boot — first boot takes 1–2 minutes
- You should see "Hello World!" on the emulator screen 🎉
Common Issues and Fixes
| Problem | Fix |
|---|---|
| Emulator is very slow | Enable Hardware Acceleration in BIOS. In AVD Manager → Edit → increase RAM to 2048 MB |
| Gradle sync failed | Check internet connection. Try File → Invalidate Caches → Restart. Check build.gradle.kts for typos |
| Missing SDK components | Go to File → Settings → Android SDK → SDK Tools tab → check missing items → Apply |
| ActivityMainBinding not found | ViewBinding not enabled. Check buildFeatures { viewBinding = true } in app build.gradle.kts and sync |
| Physical device not detected | Enable USB Debugging: Settings → Developer Options → USB Debugging. Install device USB drivers on Windows |
Using a Physical Android Device (Optional)
Running on a real device gives faster performance than the emulator. Here's how to set it up:
- On your Android phone: Settings → About Phone → tap Build Number 7 times to unlock Developer Options
- Go to Settings → Developer Options → enable USB Debugging
- Connect your phone to your computer via USB
- When prompted on the phone, tap Allow for USB debugging
- Your device appears in Android Studio's device selector — select it and run
Try It Yourself
- Change "Hello World!" — open
res/values/strings.xmland change thehello_worldstring to your name. Run the app and see the update. - Add a Button — open
activity_main.xml, drag a Button from the palette, and inMainActivity.ktuse ViewBinding to set a click listener that logs a message withLog.d("TAG", "Button clicked!"). - Enable ViewBinding — if you haven't already, enable it in
build.gradle.ktsand refactorMainActivity.ktto usebindinginstead ofsetContentView.
Your environment is set up and your first app is running. In Step 3: Android Activities, Layouts and Views — How Every Screen Is Built we learn how Android screens are built — the relationship between Activities, XML layouts, and UI components.
Frequently Asked Questions
What minimum SDK should I choose?
API 26 (Android 8.0) in 2026. Less than 1% of devices run below this. Avoid API 21 — it forces compatibility workarounds for every modern feature and offers no meaningful coverage benefit.
What is ViewBinding and why enable it?
ViewBinding generates a type-safe class from your layout. Instead of findViewById() which crashes at runtime on a wrong ID, ViewBinding fails at compile time. Enable with buildFeatures { viewBinding = true } in app/build.gradle.kts.
How do I speed up the emulator?
Enable hardware acceleration in BIOS. Increase emulator RAM to 2048 MB in AVD Manager. Use x86_64 system images — they run much faster than ARM on Intel/AMD machines. A physical device is fastest of all.
Do I need to install Java separately?
No — Android Studio bundles its own JDK. No separate Java installation needed.
- Download Android Studio from developer.android.com/studio — it's free
- No separate Java install needed — JDK is bundled
- Set Minimum SDK to API 26 — not API 21
- Enable ViewBinding immediately —
buildFeatures { viewBinding = true } - Key files:
MainActivity.kt(code),activity_main.xml(layout),AndroidManifest.xml(config) - Run on emulator with ▶ Run or Shift + F10
- Physical device: enable USB Debugging in Developer Options
- Slow emulator? → increase RAM in AVD Manager, use x86_64 image