Skip to content
BENIBIX Learn

Jetpack Compose

Development📱 Mobile DevelopmentMobile Frameworks

Also known as Compose, Android Compose, Compose UI

Android's way to build app screens in Kotlin, from small blocks.

Think of it like

Think of it like building with blocks. Each small block is one part of the screen.

Example

Jack builds a login screen in Compose from three blocks: two text boxes and one button.

Why it matters

It is how most new Android screens are built. It takes less code than the old XML way.

Definition

Jetpack Compose is the modern way to build Android screens in the Kotlin language. You write small functions that each describe a part of the screen. Compose joins them and redraws a part when its data changes. It replaced the older way of laying out screens in XML files. It is the advised way to build new Android apps.

Example code

kotlin
@Composable
fun Greeting() {
    Button(onClick = { println("Hi") }) {
        Text("Say hi")
    }
}
A Compose block with one button. Each block is a small Kotlin function.
The Jetpack Compose row: Kotlin in, and Compose draws on Android.

Common mistake

Mixing it up with Docker Compose. They share a word and nothing else.

Key takeaways

  1. 1
    Small blocks. Each part of the screen is one function.
  2. 2
    Updates itself. A change in data redraws that part.
  3. 3
    Kotlin first. Screens are written in Kotlin, not XML.