Intermediate: Android basics · Android Studio and your first app · topic 18 of 50 · 35 min
Setting up Android Studio, an emulator and your phone
Explanation
What you are installing
| Part | What it is |
|---|---|
| Android Studio | The IDE (integrated development environment): editor, designer, debugger, all in one. Based on IntelliJ IDEA. |
| Android SDK | Software Development Kit: the Android libraries and tools your app is built against, one "platform" per Android version. |
| Gradle | The build system that compiles your code and packages it into an app file. |
| Emulator | A virtual Android phone that runs on your computer. |
Installing
- Download Android Studio from developer.android.com/studio (Windows, macOS, Linux). Always use the official site.
- Run the installer and follow the Setup Wizard with the "Standard" option; it downloads the SDK, platform tools and an emulator image.
- Let it finish downloading (several GB). A stable internet connection helps; this happens once.
- Open Android Studio and create a new project with the "Empty Activity" template, which uses Jetpack Compose.
Hardware advice: Android Studio and the emulator are heavy. 8 GB of RAM works if you close other apps; 16 GB is comfortable. An SSD makes builds much faster. If your computer is slow, run apps on a real phone instead of the emulator.
Creating an emulator (AVD)
An AVD (Android Virtual Device) is a configuration for the emulator: which phone shape, which Android version. Open Device Manager in Android Studio, click Create, pick a phone such as a Pixel model, choose a recent system image, and finish. Press the Run button and pick the emulator.
The emulator needs hardware acceleration (virtualisation) to be fast. On Windows this usually means turning on virtualisation (VT-x or AMD-V) in the BIOS settings and having the Windows Hypervisor Platform feature enabled. Android Studio shows a warning with a link if acceleration is missing.
Running on your own phone
- On the phone, open Settings > About phone and tap Build number seven times. A message says you are now a developer. (On some brands, Build number is under Software information.)
- Open the new Developer options (often in Settings > System) and turn on USB debugging.
- Connect the phone with a USB data cable. Accept the "Allow USB debugging?" prompt on the phone.
- The phone appears in Android Studio's device list. Press Run.
You can also use Wireless debugging (Android 11 and later): pair the phone with Android Studio over the same Wi-Fi network using a QR code or pairing code, with no cable needed.
adb devicesCommon mistakes
- Downloading Android Studio from unofficial sites. Use developer.android.com only.
- A charge-only USB cable: the phone never appears. Use a data cable.
- Missing virtualisation, so the emulator is extremely slow or refuses to start. Enable it in BIOS, or use a real phone.
- Revoking the debugging prompt by accident. Unplug, replug and accept "Allow" again.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Setting up Android Studio, an emulator and your phone · 1/6
Android Studio is the official free tool for building Android apps.
Prefer a video by a teacher? Find free videos on “install android studio emulator usb debugging setup” on YouTube ↗
In real life: Building on a budget laptop
A college student in Lucknow has a laptop with 8 GB of RAM. The emulator makes everything slow, so she enables Developer options on her own phone and uses Wireless debugging. Builds now install on her phone in seconds, she tests on a real device with a real network, and she keeps the emulator only for checking another Android version occasionally.
Practice (0/3 done)
How do you unlock Developer options on most Android phones?
The phone is connected but never appears in Android Studio. What should you check first?
Install Android Studio, create an Empty Activity project named HelloIndia, run it on an emulator, then enable Developer options and USB (or wireless) debugging on your phone and run it there too.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Project structure and GradleAndroid Studio and your first app · same module
- Activities and the lifecycleAndroid Studio and your first app · same module
- Hello Compose: your first screenAndroid Studio and your first app · same module
- Installing FlutterFlutter and Dart · Flutter setup and your first app
- Testing basics and the test pyramidTesting Android apps
- Debugging and performanceTesting Android apps
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
What is the Android SDK?
Answer: The libraries and tools your app is built against
SDK means Software Development Kit.
What is an AVD?
Answer: A virtual device configuration for the emulator
AVD means Android Virtual Device.
What does adb devices do?
Answer: Lists connected devices
adb is the Android Debug Bridge.
Your laptop has 8 GB of RAM and the emulator is very slow. What is a good option?
Answer: Run the app on a real phone with USB or wireless debugging
Real devices are fast and realistic for testing.
Does the Flutter SDK include Dart?Related
What is the recommended modern way to build Android screens?Related
Answer: Jetpack Compose with Kotlin
Compose is Android's recommended UI toolkit.
What do you need to install to BUILD C# programs?Related
Answer: The .NET SDK
The SDK has the compiler and the dotnet tools. The runtime alone can only run built apps.
What does dart format --set-exit-if-changed do in CI?Related
Answer: Fails the job if any file is not formatted
Enforces consistent style.
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 3 more topics in “Android Studio and your first app” before its exam: Project structure and Gradle, Activities and the lifecycle, Hello Compose: your first screen.
- Module 5 exam: Android Studio and your first app · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Jetpack Compose UI. 50 topics left in the course before the final exam.