Theory
A phone that does not exist
You want to see FestConnect Mobile running, but you may not have a spare Android phone plugged in, and you certainly want to test many screen sizes and Android versions. The emulator can pretend to be any of them, but it needs to be told which phone to pretend to be.
That description, a specific virtual phone with a chosen screen and Android version, is an AVD: Android Virtual Device. Creating one is the final setup step before your first app runs.
Theory
A spec sheet for a make-believe phone
Ordering a custom phone, you would fill a spec sheet: 6-inch screen, this much RAM, running Android 14. An AVD is exactly that spec sheet, handed to the emulator, which then builds a make-believe phone matching it on your computer. Change the sheet (bigger screen, older Android) and you get a different test device, no hardware bought.
Theory
What an AVD is made of
An AVD combines two choices plus settings:
- A hardware profile: the screen size, resolution, and RAM (for example, a Pixel phone profile).
- A system image: a specific Android version / API level (for example API 34 = Android 14). This must be downloaded first.
- Plus storage size and a name.
The emulator reads the AVD and runs a virtual phone matching it. You can keep several AVDs to test different devices and Android versions.
Follow along
Create an AVD for FestConnect
- Open the Device Manager in Android Studio: Tools > Device Manager (the AVD Manager), then Create Device.
- Pick a hardware profile choose a phone like Pixel 6 (screen size, resolution, RAM come with it).
- Select a system image pick an API level such as API 34 (Android 14); download it first if it is not already installed.
- Name and finish give the AVD a name, adjust storage if needed, and click Finish; it now appears as a device.
- Launch it press the run/play icon next to the AVD (or Run your app) and the virtual phone boots up.
Think first
AVD, emulator, or app?
Three things get confused: the AVD, the emulator, and your app. In one line each, say what each is, using the FestConnect setup.
Show the answer
The AVD is the configuration (the spec sheet: a Pixel running API 34). The emulator is the program that reads that AVD and runs a virtual phone on your computer. Your app (FestConnect) is what you then install and run on that virtual phone. So: AVD describes the device, the emulator simulates it, the app runs inside it. They are three separate things students routinely merge.
Quiz
You open the AVD Manager and cannot finish creating a device because one required part is missing. What most likely needs to be downloaded first?
- The system image for the chosen API level
- A second copy of Android Studio
- The FestConnect source code
- A physical phone driver
Show the answer
The system image for the chosen API level
An AVD needs a system image (the Android version, e.g. API 34) installed before it can run, and the Manager prompts you to download it if it is missing (A). You do not need another Studio (B). The app source (C) is unrelated to defining a virtual device, and you are avoiding physical hardware entirely (D). The two ingredients are a hardware profile plus a downloaded system image.
Watch out
AVD traps
1. Confusing AVD and emulator: the AVD is the configuration; the emulator is the program that runs it. Do not use the words interchangeably in an answer.
2. No system image: you cannot create a working AVD without downloading a matching API-level image.
3. Choosing an image your machine cannot accelerate: mismatched or unaccelerated images make the emulator crawl. Prefer an image that supports hardware acceleration.
Theory
Setup done: now build something
The toolchain is installed and a virtual phone is ready. Unit 2 finally builds an app: you will create the FestConnect project, meet the Activity (a screen) and its layout, write a message, and press Run to watch it appear on your AVD. Everything from Unit 1 was so that this next step just works.
Summary
Key takeaways
- An AVD (Android Virtual Device) is a configuration describing a virtual phone for the emulator to run.
- It combines a hardware profile (screen, RAM) with a system image (an Android version / API level), plus storage and a name.
- Create it in Android Studio's Device/AVD Manager; the system image must be downloaded first.
- AVD = the spec; emulator = the program that simulates it; your app runs inside it (three different things).
- Keep several AVDs to test different devices and Android versions.
- Memory hook: an AVD is a spec sheet for a make-believe phone.