How apps work
Java to Kotlin
Why Android chose Java, escaped it, and fell for Kotlin.
4 pages44 min4 interactive6100 words
- 01Java, without the JVMAndroid chose the Java language and then built its own virtual machine to run it. The decade of litigation that followed is a story about which part of Java is actually the product: the language, the library, or the API.intermediate11 mininteractive
- 02How Kotlin took overKotlin was announced as first-class at I/O 2017 and Kotlin-first at I/O 2019. That is an unusually fast adoption curve for a language, and it happened because Kotlin solved problems Java on Android could not, without asking anyone to rewrite anything.intermediate11 mininteractive
- 03Kotlin under the hoodA data class is a hand-written class, an object is a singleton with an INSTANCE field, and a suspend function is a method with a label field. Kotlin's elegance is entirely at the source level; the bytecode is ordinary.nerd11 mininteractive
- 04Kotlin MultiplatformKMP lets one Kotlin source set compile to Android bytecode and to native iOS code. It is not a UI framework and not a rewrite; it is a way to stop writing the same business rules twice.intermediate11 mininteractive
Test yourself
Test yourself: Java to Kotlin
What did the Supreme Court hold in Google v. Oracle (2021)?