Writing your first program in Kotlin using variables and idioms
Kotlin is the recommended language for Android development; you can still use Java as your language of choice, as many legacy applications still heavily rely on Java. However, in this book, we will use Kotlin, and if this is the first time you are building Android applications using the Kotlin language, the Kotlin organization has excellent resources to help you get started with free practice exercises and self-paced assessments called Kotlin Koans (https://play.kotlinlang.org/koans/overview).
In addition, you can use the Kotlin language for multiplatform development using Kotlin Multiplatform Mobile (KMM), in which you can share standard code between iOS and Android apps and write platform-specific code only where necessary. KMM is currently in Alpha.
Getting ready
In this recipe, you can either use the online Kotlin playground (https://play.kotlinlang.org/) to run your code or run the code in your Android...