Where to Go Next — Jetpack Compose
A brief look at Jetpack Compose, Android's modern declarative UI framework built entirely on Kotlin.
3 phút đọc
This course has focused on the Kotlin language itself, not on building apps — but if Android development is why you're learning Kotlin, there's one library worth knowing exists before you go further: Jetpack Compose, Android's modern toolkit for building UI, and Google's recommended approach for new Android apps.
Declarative, not imperative
Older Android UI code was imperative: you built a screen out of XML layout files, then wrote Kotlin (or Java) code that reached into that layout and manually updated pieces of it whenever the underlying data changed — find the TextView, call .setText(), repeat for every piece of UI that could change.
Compose is declarative instead: you write a function that describes what the UI should look like for a given state, and Compose figures out how to update the actual screen when that state changes. You never call .setText() yourself.
A simple composable
@Composable
fun Greeting(name: String) {
Text(text = "Hello, $name!")
}@Composable marks a function as describing a piece of UI rather than computing a return value. Every concept from this course shows up here: Greeting is a regular Kotlin function with a regular String parameter, and Compose calls it and re-calls it as needed — there's no XML file paired with it, no separate "layout" step.
State drives the UI
Compose re-runs (or "recomposes") a composable function automatically whenever the state it reads changes:
@Composable
fun Counter() {
var count by remember { mutableStateOf(0) }
Column {
Text(text = "Count: $count")
Button(onClick = { count++ }) {
Text("Increment")
}
}
}remember { mutableStateOf(0) } creates a piece of state Compose tracks. When count++ runs inside the button's onClick lambda — a lambda, exactly like the ones covered earlier in this course — Compose notices count changed and automatically re-runs Counter() to redraw the Text with the new value. You never wrote any code that says "now update the label" — you described what the label should show for a given count, and Compose handled the rest.
Why this is worth knowing now
Every piece of syntax in those two examples was covered somewhere in this course: function declarations, string templates, lambdas, trailing lambda syntax, and var. Compose doesn't introduce a new language on top of Kotlin — it's a library that leans heavily on Kotlin features you now already know, particularly lambdas and higher-order functions, to make UI code look almost like a description of the screen rather than a sequence of instructions for building it.
Where to go from here
Jetpack Compose is a full topic of its own — state hoisting, layout composables like Column and Row, side effects, navigation, and more — well beyond what a single closing lesson can cover. If Android development is your goal, Compose (alongside coroutines from the previous lesson, which Compose relies on for anything asynchronous) is the natural next thing to learn. If you're headed toward backend development instead, Ktor and Spring Boot are the equivalent next step, built on the same Kotlin fundamentals you've just spent this course learning.