Compose Previews and Live Edit

A preview is a parameterless composable annotated with @Preview. Android Studio 234 compiles the module, loads the function into layoutlib, the Android rendering library that runs on your desktop JVM, and draws it in the editor's Split or Design view with no emulator. BookNest's baseline ships one:

MainActivity.kt: a preview with hard-coded sample dataKotlin
@Preview(showBackground = true, widthDp = 360)
@Composable
fun BaselineScreenPreview() {
    val sample = Book(1, "The Quiet Harbor", "Mara Ellison", "Fiction", 14.99, 4.6, 312, 2024,
        true, "A lighthouse keeper's daughter pieces together a decades-old disappearance.")
    MaterialTheme { Surface { BaselineScreen(listOf(sample)) } }
}

@Preview comes from ui-tooling-preview; the renderer support, ui-tooling, is a debugImplementation, so it never ships. Previews have no network or file access and cannot build an injected ViewModel, so preview composables that take plain data (Compose Previews covers the parameters).

Live Edit pushes edits into the app running on a device instead. Turn it on under File > Settings > Editor > Live Edit (Manual with Ctrl+', Manual on Save, or Automatic); a green Up-to-date mark in Running Devices confirms the device matches your code. It needs a debuggable build on API 30 or higher and changes only function bodies; a new function or changed signature needs a full run, as does any use of Apply Changes.