Skip to content

Android with Jetpack Compose

Glossary

117 terms from Android with Jetpack Compose, in plain words, each with the chapter that teaches it.

#

@Composable
A Kotlin function marked `@Composable` that describes part of the screen by calling other composables such as `Text` and `Button`.
@OptIn
An annotation meaning 'I know this feature may change, use it anyway'. TopAppBar needs it.
@Query
A Room annotation that runs the SQL you give it, such as `SELECT * FROM orders ORDER BY placedAt DESC`.

A

abstract class
A class that can't be created directly and may have functions with no body. Room's OrderDatabase is abstract: Room writes a real subclass that fills in `orderDao()`.
activity
One window of an app, which Android starts to run your app. KettleOrder has one, `MainActivity`.
adb (Android Debug Bridge)
A command-line tool that communicates with an Android emulator or connected phone from a computer. It can install apps, open a shell, and run commands such as `adb shell am kill`, which ends a backgrounded app's process the way Android does when it needs memory.
Alignment
Controls how items are positioned across the direction a layout doesn't run in, such as centering a Row's items top to bottom.
Alt+Enter
The Android Studio shortcut that fixes the red name under the cursor, usually by adding the missing import.
Android
The operating system on most of the world's phones, which KettleOrder runs on.
Android SDK (Software Development Kit)
The libraries and tools that turn your Kotlin code into an app a phone can install. Android Studio downloads it for you.
Android Studio
Google's free editor for writing, running and testing Android apps, built on IntelliJ IDEA.
androidx
The package name that all Jetpack libraries start with, such as `androidx.compose`.
annotation
A label starting with `@` that tells the compiler or a library something about the code below it, such as `@Composable` or `@Serializable`.
API (application programming interface)
A program that other programs call, here over the web. KettleOrder asks the shop's menu API for the drinks.
API level
The number of an Android version; Android 16 is API 36 and Android 13 is API 33. Gradle settings such as `minSdk` use these numbers.
applicationId and namespace
Two Gradle settings in the app's `android { }` block: `applicationId` is the app's unique ID on phones and Google Play (never change it after you publish), and `namespace` is your code's package name.
Arrangement
Controls how a Row or Column spaces its items along its main direction, such as an 8.dp gap between drink cards.
assertion
A check in a test, such as `assertEquals`, that fails the test when the result isn't what you expected. For Double values, add a delta.

B

back stack
The list of screens the user has visited, with the one on show at the end. Back removes the last one.
Box
A composable that layers its content on top of each other, such as a 'New' label over a picture.
Bundle
A bag of saved data that Android gives back when an activity is recreated. `rememberSaveable` stores values in it.
Button
A composable that shows content, usually a `Text`, and runs its `onClick` lambda on each tap. `TextButton` has no background and `OutlinedButton` has a thin border.

C

CancellationException
The exception a Kotlin coroutine uses to be told to stop. It signals a normal cancellation rather than a real error, so code that catches exceptions should re-throw it instead of treating it as a failure or showing an error message.
Card
A Material 3 composable that draws a raised, rounded surface to group related content, like one drink in DrinkCard.
collectAsStateWithLifecycle
Collects a StateFlow into Compose state so the screen recomposes on each new value, pausing while the app is in the background.
Column
A composable that stacks its content from top to bottom.
Compat classes
AndroidX classes ending in `Compat` that do the Android version checks for you, so they work the same on old and new phones.
ComponentActivity
Jetpack's base activity class. MainActivity inherits from it and gets everything an activity needs.
configuration change
A change such as rotating the phone that makes Android throw the activity away and recreate it, losing anything stored with plain `remember`.
const val
A `val` whose value is fixed when the code is compiled, used for settings written in the code such as `BASE_URL`.
contentPadding
Padding added inside a lazy list's scrolling area, so the first and last rows aren't stuck to the edges while the list stays full size.
Context
Android's handle on your app, which libraries need to reach files, resources and system services. `applicationContext` lasts as long as the app.
coroutine
A task that can pause while it waits, such as for the network. `viewModelScope.launch` starts one that belongs to a view model.
createComposeRule
Makes the test rule that lets a Compose UI test show composables with `setContent` and then find and click them.

D

DAO (data access object)
An interface listing the database jobs the app needs, such as OrderDao's `insert` and `all`. Room writes the code behind each function.
data object
A Kotlin object with one shared instance and no fields, used for routes that need no extra information, such as MenuRoute.
declarative
A way of building screens where you describe what the screen should look like for the current data, and Compose works out how to draw it.
dependencies
The block in the Gradle file that lists libraries the app uses, with lines such as `implementation("group:name:version")`.
dependency injection
Handing an object the parts it needs, such as OrderViewModel's API and DAO, through its constructor instead of letting it build them. That lets a test pass in a fake.
dp (density-independent pixels)
The unit for sizes and spacing, so 16.dp looks the same on any screen. `sp` is the same for text but also follows the user's font-size setting.

E

emulator
A program that runs a virtual phone on your computer, using a system image of an Android version.
enableEdgeToEdge
A call that lets the app draw behind the system bars, which is why Scaffold passes `innerPadding`.
entity
A data class that Room stores as a table: each property is a column and each object is a row.
entryProvider
Says what to draw for each route in NavDisplay, with one `entry<Route> { }` per screen.

F

flow
A stream of values that arrive one after another, which code can collect as they come.

G

GET
The HTTP request that asks a server for data, as `@GET("menu.json")` does.
Google Play publishing
Releasing an app: you make a signed Android App Bundle with your upload key, upload it in the Google Play Console (a one-time US$25 developer account), and test it before production.
Gradle
The build tool that compiles the app and downloads its libraries, configured in files such as `build.gradle.kts`.
Gradle sync
The step where Gradle reads the build files and downloads the libraries they list. Run it after any Gradle change.
gradlew
The project's Gradle command-line wrapper. `./gradlew test` runs local tests and `./gradlew connectedAndroidTest` runs device tests.

H

Hilt
A library that builds objects such as the API and DAO and hands them out for you, saving manual wiring code.

I

inheritance
When a class gets everything from a parent class and adds its own parts. MainActivity is a subclass of ComponentActivity.
instrumented test
A test in app/src/androidTest that runs on an emulator or phone, so it can use Android and composables.
IOException and HttpException
Two kinds of failed network call: `IOException` means no answer came back at all (usually no connection), and Retrofit's `HttpException` means the server answered with an error code such as 500.

J

Jetpack
Google's collection of Android libraries (the `androidx` packages). Jetpack Compose is its toolkit for building screens from Kotlin functions.
JSON
A text format for data, with lists in square brackets and objects of named fields in curly braces. The menu comes back from the web as JSON.
JUnit
The usual JVM test library. A test is a function marked `@Test` that checks results with assertions.

K

key
In a lazy list, a value that identifies each row, so Compose follows each item when the list changes. The item's ID is the natural key.
kotlinx.serialization
Kotlin's library, plus a Gradle plugin, for turning `@Serializable` classes into JSON and back. `ignoreUnknownKeys` skips extra fields.
KSP (Kotlin Symbol Processing)
A build tool that reads annotations and writes extra code. Room uses it to generate the code behind your DAO.

L

lambda parameter `it`
The default name for a lambda's single parameter, such as the new text in `onValueChange = { name = it }`.
lazy list
A list that builds only the rows on screen. `LazyColumn` scrolls vertically, with `item { }` for one row and `items(list) { }` for one per element.
local unit test
A test in app/src/test that runs on your computer in seconds, without a device. It suits plain Kotlin such as `Cart`.
Logcat
The Android Studio window that shows messages from the running app, including `println` output and crash errors.

M

manifest
The XML file that tells Android the app's name, icon, activities and permissions.
Material 3
Google's current design system. `MaterialTheme` supplies the color scheme and text styles such as `titleMedium` that screens share.
minSdk, targetSdk, compileSdk
Three API-level settings in the app's Gradle file: `minSdk` is the oldest Android version the app installs on, `targetSdk` the newest you've tested against, and `compileSdk` the version whose features your code can use.
modifier
A `Modifier` value that changes a composable's size, spacing or behavior, chained with dots. Order matters.
MutableStateFlow
A StateFlow whose value can be changed. A view model keeps one private and shows screens a read-only view via `asStateFlow()`.
mutableStateOf
Makes a state holder that Compose watches. When its `.value` changes, composables that read it are redrawn.

N

NavDisplay
The Navigation 3 composable that shows the screen for the last route in the back stack.
navigation
Moving between an app's screens while remembering where the user has been, so Back returns to the previous screen. In Navigation 3, the back stack is an ordinary list of routes that the app changes itself by adding to it or removing the last item.
NavKey
The interface a route implements to be a Navigation 3 key, such as `MenuRoute : NavKey`.
notification channel
A category of notifications, such as 'Orders', that users can turn on or off in Settings. Every notification belongs to one.

O

OkHttp
Square's HTTP library, which Retrofit uses to send requests.
onCreate
The function Android calls when an activity starts; MainActivity overrides it to call `setContent`.
OutlinedTextField
A box the user types into. You give it the current `value`, and it reports each key press through `onValueChange`, where your lambda stores the new text.
override
Replaces the parent class's version of a function. `super.onCreate(...)` runs the parent's version first.

P

permission
Something your app must hold before Android lets it do a protected thing, such as use the internet or show notifications. It is declared in the manifest.
plugin
A Gradle add-on that does extra work at build time, such as the serialization plugin or KSP writing code.
POST
An HTTP request that sends data to a server instead of fetching it. With Retrofit, `@Body` marks the data sent.
preview
A function marked `@Preview` that Android Studio draws beside your code, so you can see a composable without running the emulator.
primary key
A table column whose value is different in every row. With `autoGenerate = true`, the database numbers orders 1, 2, 3 and so on.
process death
Android ending a background app's process to free memory. The screen is rebuilt when the user returns, but view models start fresh.
property delegation
Kotlin's `by` keyword, which passes a property's reads and writes to another object. With it, `cups` acts like a plain Int backed by a state holder.

R

raw string
A string between triple quotes `"""` that can hold quote marks and line breaks as they are, which suits JSON.
recomposition
Compose running composables again because state they read has changed, so the screen shows the new data.
remember
Runs its lambda only the first time and returns the same result on later calls, so state survives recomposition. It is lost on rotation.
rememberLauncherForActivityResult
A Compose function that returns a launcher for asking the system something, such as a runtime permission; its lambda runs when the user has answered. Call `launch` only from an event like `onClick`.
rememberSaveable
Works like `remember` but also saves the value in the Bundle, so it survives rotation and process death.
res
The folder of app resources such as icons and text. The app name lives in `values/strings.xml`.
Retrofit
A library from Square that turns an interface such as `MenuApi` into working HTTP calls and decodes the replies.
Room
Jetpack's library for storing data in an SQLite database on the phone. You write annotated classes and Room writes the SQL code.
route
The key that names a screen in the back stack, such as MenuRoute. A data class route can carry values like an item's ID.
Row
A composable that puts its content side by side, left to right.
runtime permission
A permission the app must also request while it runs, and the user can refuse, such as POST_NOTIFICATIONS. Install-time permissions like INTERNET are granted automatically.

S

SavedStateHandle
A small key-value store a view model can ask for, which Android saves and restores through process death. KettleOrder saves the cart in it as JSON.
Scaffold
A Material 3 composable that lays out a standard screen, with a slot for a top bar and an `innerPadding` that keeps content clear of the system bars.
sealed interface
A type with a fixed list of kinds, so a `when` on it must handle each one and the compiler catches a forgotten case.
setContent
Hands the activity's screen to Compose; its lambda describes what to show.
Spacer
A composable that adds an empty gap between items, such as `Spacer(Modifier.height(8.dp))`.
SQL (Structured Query Language)
The language used to talk to databases, such as `SELECT * FROM orders`.
SQLite
The small database built into Android phones that keeps tables of data in one file.
state
Data that can change while the app runs and that the screen shows. When it changes, Compose redraws what uses it.
state hoisting
Moving state up out of a composable into its caller, so the composable becomes stateless and reusable. The rule is 'state down, events up'.
StateFlow
A flow that always holds one current value and sends each new value to whoever is collecting. View models use it to share state with screens.
suspend
Marks a function that can pause while it waits, such as a network or database call, so the screen never freezes. It must run in a coroutine.

T

test rule
An object JUnit sets up before each test and cleans up after, such as `createComposeRule()`.
Text
The composable that shows a piece of text on screen. It takes a `String`, so numbers need a string template such as `"$quantity"`.
TopAppBar
A Material 3 composable for a screen's title bar, passed to `Scaffold(topBar = ...)`. Its `actions` slot holds buttons on the right. It is still experimental, so it needs `@OptIn`.

U

UI state
One data class, such as OrderUiState, holding everything a screen shows: the menu, cart, loading flag, error and history.
unidirectional data flow
State flows down from the view model to the screens, and events such as an Add tap flow up as function calls.
USB debugging
A phone setting, shown after tapping Build number seven times, that lets Android Studio run your app on a real phone.

V

version catalog
The file `libs.versions.toml` that lists library names and versions in one place. Gradle lines such as `libs.` look things up there.
ViewModel
A class that holds a screen's state and logic and survives rotation. It is cleared when the user leaves for good, but not saved through process death.
viewModelScope
A coroutine scope that belongs to a view model and is canceled when the view model is cleared.

W

weight
A modifier inside a Row or Column that gives an item a share of the spare space, such as pushing the Add button to the right edge.