A guide to Kotlin for Mobile Development

How to Work Through the Kotlin Course

Read the levels in order. Levels one and two are the language, and every later page assumes them; skipping ahead to Compose without null safety and sealed classes means reading code you cannot yet parse.

Type the examples rather than skimming them. Kotlin's conveniences - trailing lambdas, the elvis operator, scope functions - only become automatic through use, and reading them is not the same as writing them. Each example is deliberately short enough to retype in under a minute.

Use play.kotlinlang.org for levels one to four. It compiles in the browser with nothing to install and is more than enough for everything up to coroutines. Install Android Studio when you reach level five, and expect the first project sync to take a while.

Take each level's check before moving on. The questions are written to catch the specific misunderstandings that cause trouble later - the dispatcher question in level four and the modifier-order question in level five are both drawn from mistakes that are hard to debug and easy to avoid.

When something does not compile, read the error rather than rearranging code until it passes. Kotlin's compiler messages are unusually specific, and the type it expected against the type it found is nearly always the whole answer. The official documentation at kotlinlang.org is excellent and is organised the same way this course is.