Kotlin
The main language of modern Android apps
Learn Kotlin, the main language of modern Android apps, from scratch: from variables, conditions and loops to null safety, lambdas, collections and classes. Every example shows the program's exact output, so you understand step by step how the code works. By the end you will have met coroutines and Jetpack Compose and be ready to start Android development.
Course content
Kotlin basics
BeginnerWrite your first program, get to know variables, types and strings, and teach your program to make decisions and repeat work.
- 1What is Kotlin? Your first programFind out who created Kotlin, where it is used and how it works, and write your first program with `fun main()`.12 min
- 2Variables, types and stringsCreate variables with `val` and `var`, learn the basic types and type inference, and build text with string templates.16 min
- 3Conditions, when and loopsTeach your program to make decisions: `if` as an expression, `when`, ranges, and `for` and `while` loops.18 min
Null safety, functions and collections
IntermediateProtect your code from null errors, write your own functions and lambdas, and work with lists, sets and maps.
- 4Null safetyHow Kotlin protects you from the most famous cause of app crashes: `?` types, `?.`, `?:`, `!!` and smart casts.15 min
- 5Functions and lambdasWrite your own functions: default values and named arguments, single-expression functions, extension functions, lambdas and higher-order functions.20 min
- 6Collections: List, Set and MapStore many values in lists, sets and maps, and process them with `forEach`, `map`, `filter` and other functions.20 min
Classes and modern Kotlin
AdvancedBuild classes, data classes and inheritance, then take your first step into Android with sealed classes, coroutines and Jetpack Compose.
- 7Classes, data classes, inheritance and interfacesBundle data and behaviour together: classes, constructors, data classes, `object` and companion objects, inheritance with `open`, and interfaces.24 min
- 8Sealed classes, coroutines and Jetpack ComposeMeet three key tools of a modern Android app: describe states with sealed classes, do work with coroutines without freezing the screen, and build the UI with Jetpack Compose.22 min
Android app development
AdvancedBuild screens with Jetpack Compose in Android Studio, manage state with a ViewModel, navigate between screens, load data from the internet and store it on the device, then publish your app on Google Play.
- 9Android Studio and your first appInstall Android Studio, create a Compose project, understand the project structure and the Gradle Kotlin DSL files, run the app on an emulator and on a phone, and read log messages in Logcat.20 min
- 10Building UI with Jetpack ComposeBuild a screen from composable functions: control size and spacing with Modifier, arrange elements with Row, Column, Box and LazyColumn, use Material 3 components and see the result instantly with @Preview.22 min
- 11State and architecture: ViewModel and MVVMKeep state in Compose with `remember` and `mutableStateOf`, hoist it up, move the screen's data into a ViewModel with StateFlow, and structure the app in the MVVM style with unidirectional data flow.22 min
- 12Navigation and listsMove between screens with Navigation Compose, pass arguments with type-safe routes, manage the back stack, and build fast, stable lists in LazyColumn with keys.22 min
- 13Data: networking, Room and DataStoreLoad JSON from a server with Retrofit or Ktor, run requests with coroutines in the ViewModel without freezing the screen, keep lists in a Room database and settings in DataStore.25 min
- 14Publishing and best practicesVersion your app, sign it and publish it through the Google Play Console; write tests, make the app accessible to everyone and check its performance in a release build.24 min