Android Studio is the official IDE for Android development. It bundles the Android SDK, Gradle build system, emulator, and tools like Layout Editor, Logcat, and Profiler — everything you need to build and test apps.
Before writing code, you need a working development environment. This guide walks through installation on all major platforms, then covers JDK configuration, SDK components, emulator setup, and Gradle fundamentals.
Step 1
Install Android Studio
Step 2
Configure JDK & SDK
Step 3
Create AVD & Run
System requirements: 8 GB RAM minimum (16 GB recommended), 8 GB free disk space (SSD preferred), 1280×800 screen resolution. Enable virtualization (Intel VT-x / AMD-V) in BIOS for faster emulators.
On first launch, the Setup Wizard downloads the latest SDK, platform tools, and emulator images.
PowerShell — Verify installation# Check Android Studio version (after adding to PATH if needed)
studio64.exe --version
# Verify SDK path (default location)
dir "$env:LOCALAPPDATA\Android\Sdk"
Windows tip
If the emulator is slow, enable Windows Hypervisor Platform (WHPX) or use an Intel HAXM-compatible setup. On Windows 11, ensure virtualization is enabled in BIOS and "Virtual Machine Platform" is turned on in Windows Features.
3Installing Android Studio on Linux
Download the .tar.gz archive from the official site, or use your package manager where available.
Manual install (tar.gz)
Bash — Extract and launch# Extract to /opt or your home directory
sudo tar -xzf android-studio-*.tar.gz -C /opt/
# Launch Android Studio
/opt/android-studio/bin/studio.sh
Bash — Enable KVM# Check if KVM is available
egrep -c '(vmx|svm)' /proc/cpuinfo
# Add user to kvm group
sudo usermod -aG kvm $USER
sudo usermod -aG plugdev $USER
Desktop entry: Use Tools → Create Desktop Entry inside Android Studio to add a launcher icon to your application menu.
Open the DMG and drag Android Studio into the Applications folder.
Launch from Applications. If macOS blocks it, go to System Settings → Privacy & Security and click Open Anyway.
Complete the Setup Wizard — it downloads SDK components automatically.
Default SDK path: ~/Library/Android/sdk
Terminal — Environment variables (~/.zshrc)# Add to ~/.zshrc or ~/.bash_profile
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
Apple Silicon (M1/M2/M3)
Use ARM64 system images in the SDK Manager for best emulator performance. Android Studio natively supports Apple Silicon — no Rosetta required for the IDE itself.
5JDK Setup
Android Studio ships with an embedded JetBrains Runtime (JBR) based on OpenJDK — you usually don't need a separate JDK install. For command-line builds or CI, you may configure JDK separately.
Android Gradle Plugin
Minimum JDK
Recommended
AGP 8.x
JDK 17
JDK 17 (LTS)
AGP 7.x
JDK 11
JDK 17
Configure JDK in Android Studio
Open File → Settings (Windows/Linux) or Android Studio → Settings (macOS).
Navigate to Build, Execution, Deployment → Build Tools → Gradle.
Under Gradle JDK, select Embedded JDK or a installed JDK 17.
The Android Emulator simulates a real device on your computer. It uses a system image (a snapshot of Android OS) and virtual hardware (RAM, storage, sensors).
Hardware acceleration
Required for usable performance — KVM (Linux), WHPX/Hyper-V (Windows), or Hypervisor.framework (macOS).
System image
Download via SDK Manager — choose Google APIs or Google Play image for Play Store apps.
RAM allocation
Assign 2–4 GB RAM per AVD. Don't exceed half your system RAM across all running emulators.
Install emulator via SDK Manager
Open SDK Manager → SDK Tools tab.
Check Android Emulator and at least one System Image (e.g., API 34, Google APIs).
Click Apply to download.
Bash — List available emulatorsemulator -list-avds
# List all downloadable system images
sdkmanager --list | grep system-images
8Creating a Virtual Device (AVD)
An Android Virtual Device (AVD) defines a specific device configuration: screen size, API level, and hardware profile.
Steps in Device Manager
Open Tools → Device Manager (or the phone icon in the toolbar).
Click Create Device (+).
Select hardware: Choose a phone profile (e.g., Pixel 7) — defines screen size and density.
Select system image: Pick a downloaded API level (e.g., API 34, Google APIs, arm64-v8a on Apple Silicon).
Verify configuration: Name your AVD (e.g., Pixel_7_API_34), adjust RAM, internal storage, and enable snapshot boot if desired.
Gradle is the build system Android uses to compile code, merge resources, run tests, and produce APK/AAB files. Android Studio manages Gradle via wrapper scripts — you rarely install Gradle globally.
Bash — Gradle wrapper# Build debug APK
./gradlew assembleDebug
# Install debug APK on connected device/emulator
./gradlew installDebug
# Run unit tests
./gradlew test
# Clean build artifacts
./gradlew clean
Sync after changes
After editing Gradle files, click Sync Now in the banner or use File → Sync Project with Gradle Files. Failed syncs usually mean a version mismatch between AGP, Gradle, and JDK.
10Running Your First Emulator
Once your AVD is created, you can launch it from Device Manager or the command line, then deploy an app.
Launch from Android Studio
1
Open Tools → Device Manager and click the Play button next to your AVD.
2
Wait for the emulator to boot (first boot may take 1–2 minutes).
3
Create a new project: File → New → New Project → Empty Activity.
4
Select your running emulator in the device dropdown and click Run (green triangle) or press Shift + F10.
Launch from command line
Bash — Start emulator & verify device# Start a specific AVD
emulator -avd Pixel_7_API_34
# In another terminal — confirm device is connected
adb devices
# Output example:
# List of devices attached
# emulator-5554 device
# Install and launch a debug build
./gradlew installDebug
Troubleshooting
Problem
Solution
Emulator won't start
Enable virtualization in BIOS; install HAXM/KVM/WHPX
adb devices shows offline
Run adb kill-server then adb start-server
Very slow emulator
Use ARM64 image on Apple Silicon; allocate more RAM; use cold boot once, then snapshots
Set ANDROID_HOME and create local.properties with sdk.dir=...
Success check: Your emulator shows the Android home screen, adb devices lists it as device, and running a new Empty Activity project displays "Hello World" on the virtual screen. You're ready for the next lesson — building your first app!
Installation & Setup MCQ Practice
10 Basic MCQs10 Advanced MCQs
10 Basic Installation & Setup MCQs
1
What is the official IDE for Android development?
AEclipse
BXcode
CAndroid Studio
DNetBeans
Explanation: Android Studio is Google's official IDE built on IntelliJ IDEA.
2
Which JDK version is recommended for modern Android Studio?
AJDK 8
BJDK 17
CJDK 21 only
DNo JDK needed
Explanation: Android Studio Giraffe+ targets JDK 17 for Gradle and the IDE.
3
What does AVD stand for?
AAndroid Virtual Device
BApplication Version Directory
CAutomated Virtual Debugger
DAndroid Visual Designer
Explanation: An AVD is an emulator configuration representing a virtual phone or tablet.
4
Where do you install Android SDK platforms and system images?
APlay Console
BGradle Wrapper
CSDK Manager
DManifest editor
Explanation: SDK Manager in Android Studio downloads platforms, build-tools, and emulator images.
5
Which environment variable typically points to the Android SDK?
AANDROID_HOME
BJAVA_SDK
CGRADLE_PATH
DADB_ROOT
Explanation: ANDROID_HOME (or ANDROID_SDK_ROOT) helps tools locate the SDK outside the IDE.
6
What build system does Android use by default?
AMaven
BGradle
CAnt
DBazel only
Explanation: Gradle builds, packages, and manages dependencies for Android projects.
7
Which command lists connected devices and emulators?
Aadb devices
Bgradle list
Csdk list
Djava -devices
Explanation: adb devices shows authorized devices; status 'device' means ready.
8
Which project file stores the local SDK path?
Abuild.gradle.kts
Bsettings.gradle
Clocal.properties
Dgradle.properties
Explanation: local.properties contains sdk.dir and is machine-specific (gitignored).
9
Emulator hardware acceleration on Windows often uses?
ARosetta
BWHPX or Intel HAXM
CDocker only
DBIOS disable
Explanation: Virtualization must be enabled in BIOS; WHPX (Hyper-V) or HAXM accelerates the emulator.
10
Which CLI tool manages AVDs?
Agradlew
Bsdkmanager only
Clint
Davdmanager
Explanation: avdmanager create/delete/list virtual devices from the command line.
10 Advanced Installation & Setup MCQs
11
Gradle sync often fails when?
AJDK mismatch or no network
BApp has too many Activities
CEmulator is running
DUsing Kotlin
Explanation: Verify JDK 17, internet access, and compatible Android Gradle Plugin versions.
12
compileSdk differs from minSdk because compileSdk is?
AOldest supported device
BVersion used at compile time
CPlay Store target
DEmulator API only
Explanation: minSdk is minimum supported; compileSdk is the SDK version your code compiles against.
13
On Apple Silicon Macs, which emulator image runs best?
Aarm64-v8a
Bx86 only
Cmips
DUniversal APK
Explanation: ARM64 system images run natively without x86 translation overhead.
14
sdkmanager --list shows?
AGradle tasks
BLogcat buffer
CAvailable and installed SDK packages
DAVD screenshots
Explanation: sdkmanager installs and lists SDK components from the command line.
15
The Gradle Wrapper (gradlew) ensures?
ASame Gradle version for all developers
BFaster emulator boot
CAutomatic Play Store upload
DJDK auto-install
Explanation: gradlew downloads the pinned Gradle version declared in gradle-wrapper.properties.
16
adb kill-server && adb start-server fixes?
AAPK signing errors
BStale/offline adb connections
CLayout inflation crashes
DMissing R class
Explanation: Restarting the adb daemon clears stuck or offline device states.
Explanation: Gradle and some CLI tools use JAVA_HOME to find the Java installation.
19
Cold Boot vs Quick Boot on emulator?
ASame thing
BCold deletes app data always
CCold full restart; Quick Boot uses snapshot
DQuick Boot requires physical device
Explanation: Quick Boot restores RAM snapshot for faster startup after first cold boot.
20
local.properties should be?
ACommitted to git for all devs
BGitignored and machine-specific
CEdited only by Gradle
DShared in Play Console
Explanation: SDK paths differ per machine; never commit secrets or local paths.
Click an option to select, then check answers.
Installation & Setup Interview Q&A
15 topic-focused questions for interviews and revision.
1What are the main steps to set up Android development on a new machine?easy
Answer: Install Android Studio, ensure JDK 17, open SDK Manager to install platform-tools and a system image, create an AVD, set ANDROID_HOME if using CLI, and verify with adb devices.
2What is the difference between SDK Manager and AVD Manager?easy
Answer: SDK Manager installs SDK platforms, build-tools, and emulator images. AVD Manager creates virtual device configurations (screen size, API level, image) that use those SDK components.
3Why is JDK 17 required for recent Android Studio versions?medium
Answer: Modern Android Gradle Plugin and the IDE itself compile and run on JDK 17; older JDK versions cause Gradle sync and build failures.
4How do you fix 'SDK location not found'?medium
Answer: Create or edit local.properties with sdk.dir pointing to your SDK path, or set ANDROID_HOME/ANDROID_SDK_ROOT and restart Android Studio.
5What is adb and when do you use it?easy
Answer: Android Debug Bridge is a command-line tool to install APKs, view logcat, forward ports, and interact with devices/emulators during development and debugging.
6Explain Gradle's role in an Android project.medium
Answer: Gradle compiles source, processes resources, runs dex, signs builds, resolves dependencies from repositories, and produces APK/AAB outputs via Android Gradle Plugin tasks.
7What virtualization requirements exist for the Android emulator?hard
Answer: Enable Intel VT-x/AMD-V in BIOS; on Windows use WHPX or HAXM; on Mac use Hypervisor.framework; on Linux use KVM. Without acceleration, emulation is very slow.
8How do you create an AVD for testing Android 14?easy
Answer: Open Device Manager, Create Device, pick hardware profile, select a system image with API 34, finish wizard, optionally enable Quick Boot snapshot.
9What goes in gradle.properties vs local.properties?medium
Answer: local.properties holds machine-local sdk.dir; gradle.properties holds project Gradle JVM args, AndroidX flags, and other build settings shared across the team.
10How do you run an app on a physical device?easy
Answer: Enable Developer Options and USB debugging on the device, connect via USB, authorize the computer, select the device in Android Studio run target, click Run.
11What causes Gradle sync to hang or fail repeatedly?hard
Answer: Common causes: proxy/firewall blocking downloads, wrong JDK, corrupted Gradle cache, incompatible AGP version, or missing Google/Maven repositories in settings.
12Difference between ANDROID_HOME and ANDROID_SDK_ROOT?medium
Answer: Both refer to the SDK directory; ANDROID_SDK_ROOT is the newer canonical name but ANDROID_HOME remains widely supported by tools and documentation.
13How do you update Android Studio and SDK components safely?medium
Answer: Use Help → Check for Updates for the IDE; use SDK Manager for platforms and tools; update AGP in project Gradle files incrementally and sync.
14What is the purpose of platform-tools?easy
Answer: Platform-tools include adb, fastboot, and systrace — essential for deploying apps, debugging, and low-level device communication.
15Describe troubleshooting when the emulator shows 'offline' in adb devices.hard
Answer: Restart adb server, cold boot the AVD, wipe emulator data, verify virtualization is enabled, update emulator via SDK Manager, or recreate the AVD.