Skip to content

Lesson 01 · Android with Kotlin & Compose

Android: Kotlin Fundamentals

Kotlin for developers who already know Python: val and var with type inference, deep null safety, functions with defaults and named arguments, data classes, when expressions, and collections with lambdas.

Prerequisites: Object-oriented design

Learning objectives
By the end of this lesson, you will be able to:
  • Declare values with val and var, leaning on type inference and reaching for explicit types only when inference cannot see them
  • Handle nullable types safely with safe calls, the elvis operator and let - and explain why !! is a code smell
  • Write functions with default and named arguments and single-expression bodies
  • Model data with classes and data classes, including init blocks and the members the compiler generates
  • Branch with when expressions and transform collections with map, filter, any and sumOf