Let's think about it for a second
Running an app on the emulator (or a physical device) is as simple as clicking the 'Run' button (▶) — Android Studio compiles your code, builds an APK (Android Package), and installs/launches it on the device. If your root composable is called inside a `setContent { }` block, that UI will appear immediately when the app opens.
Let's connect this to a real-world scenario
If `MainActivity.kt` contains `setContent { Greeting("Android") }`, then clicking Run will immediately show 'Hello, Android!' on the emulator screen — that's your very first real Android app.
Let's look at an example together
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Greeting(name = "Android")
}
}
}You should see the text 'Hello, Android!' on the emulator screen.Try it in 5 minutes
Edit `MainActivity.kt`, add `setContent { Greeting("Android") }`, and click the 'Run' button — confirm the app launches instantly on the emulator.
A quick word of caution
Your first build can take a few minutes (depending on your internet connection) because Gradle needs to download dependencies — don't assume it's 'stuck', just watch the progress in the Build tab.