Skip to content

Setting Up Android Studio & the Emulator

← Part 3 Overview

S7 Inf A3 — Java for Graphical and Mobile Programming
Stéphane Derrode — Centrale Lyon

Do this before your first Android lab session (TD6). The full setup takes 30–60 minutes depending on your internet connection (the SDK download is large). If you encounter problems, come 10 minutes early to the session.


What you will install

Tool Purpose Size
Android Studio IDE + Android SDK ~1 GB
Android SDK API 33 Android 13 platform ~500 MB
Pixel 6a system image (x86_64) Emulator image ~1.5 GB

Total disk space needed: approximately 8 GB (Android Studio + SDK + emulator).


Step 1 — Download Android Studio

  1. Go to https://developer.android.com/studio
  2. Click Download Android Studio — the site detects your OS automatically
  3. Run the installer:
  4. Windows: run the .exe, accept all defaults, install to C:\Program Files\Android\
  5. macOS: open the .dmg, drag Android Studio to Applications
  6. Linux: unzip the archive, run bin/studio.sh

On first launch, Android Studio runs a Setup Wizard — follow the steps below.


Step 2 — Setup Wizard

When Android Studio launches for the first time:

  1. Click Next on the welcome screen
  2. Choose Standard installation type → Next
  3. Choose your UI theme (Light or Dark) → Next
  4. Android Studio downloads the SDK — this takes several minutes
  5. Click Finish when the download is complete

Step 3 — Install API 33 (Android 13)

If the SDK Manager didn't install API 33 automatically:

  1. Open Android Studio → Tools → SDK Manager
  2. In the SDK Platforms tab, check Android 13.0 (API 33)
  3. In the SDK Tools tab, verify these are checked:
  4. Android SDK Build-Tools 33
  5. Android Emulator
  6. Android SDK Platform-Tools
  7. Click ApplyOK → wait for download

Step 4 — Create the Pixel 6a Emulator

  1. Open Tools → Device Manager (or AVD Manager in older versions)
  2. Click Create device (or the + button)
  3. Under Phone category, select Pixel 6aNext
  4. Select system image:
  5. Tab: x86 Images
  6. Row: API Level 33, ABI x86_64, Target: Android 13.0 (Google APIs)
  7. If not downloaded yet: click the Download link next to it → wait
  8. Click NextFinish

Configure for better performance (optional)

Before clicking Finish, click Show Advanced Settings: - RAM: 2048 MB minimum (4096 if your machine has ≥ 16 GB RAM) - VM heap: 512 MB - Internal storage: 2048 MB


Step 5 — Start the Emulator

  1. In Device Manager, click the ▶ Play button next to Pixel 6a API 33
  2. Wait for the emulator to boot (first boot takes 2–3 minutes)
  3. The Android home screen should appear

Useful emulator shortcuts:

Action Shortcut
Rotate landscape Ctrl + Left/Right (Windows/Linux) or Cmd + Left/Right (macOS)
Home button Ctrl + H / Cmd + H
Back button Escape
Volume up/down Ctrl + Up/Down
Power button Ctrl + P

Step 6 — Verify with Hello World

  1. In Android Studio: File → New → New Project
  2. Template: Empty Views ActivityNext
  3. Name: HelloAndroid, Language: Java, Min SDK: API 26Finish
  4. Wait for Gradle sync
  5. Click ▶ Run (Shift+F10) — select the Pixel 6a emulator
  6. The app should launch showing "Hello World!"

If you see "Hello World!" on the emulator, your setup is complete.


Troubleshooting

Emulator is very slow
→ Enable hardware acceleration. On Windows: install Intel HAXM via SDK Manager → SDK Tools → Intel x86 Emulator Accelerator (HAXM installer). On Linux: install KVM (sudo apt install qemu-kvm).

"HAXM is not installed" on macOS with Apple Silicon
→ Apple Silicon (M1/M2) cannot use x86 HAXM. In Step 4, choose ARM Images tab instead of x86 Images, and select arm64-v8a. Performance will be better on Apple Silicon with ARM images anyway.

Gradle sync failed: "SDK location not found"
→ Go to File → Project Structure → SDK Location and point it to your Android SDK folder (usually C:\Users\YourName\AppData\Local\Android\Sdk on Windows or ~/Library/Android/sdk on macOS).

"Cannot resolve symbol R"
→ Your XML file has a syntax error. Fix the XML then Build → Rebuild Project (Ctrl+F9).

App installs but immediately crashes
→ Open Logcat (bottom panel), filter by your app's package name, read the red error lines from top to bottom. The first red line usually pinpoints the problem.

No emulator appears in the run target
→ Make sure the emulator is running (you should see the Android home screen). If not, start it from Device Manager first.


Android Studio Shortcuts

Action Windows/Linux macOS
Run app Shift+F10 Ctrl+R
Debug app Shift+F9 Ctrl+D
Rebuild project Ctrl+F9 Cmd+F9
Auto-import Alt+Enter Option+Enter
Format code Ctrl+Alt+L Cmd+Option+L
Go to definition Ctrl+B Cmd+B
Rename Shift+F6 Shift+F6
Open Logcat Alt+6 Cmd+6
Open file Ctrl+Shift+N Cmd+Shift+O
Search everywhere Shift+Shift Shift+Shift