Google Announces Kotlin Support for Android
Published:
Google announced first-class Kotlin support for Android at Google I/O on May 17, 2017, endorsing Kotlin as an officially supported language for Android development alongside Java. Kotlin was created by JetBrains (the company behind IntelliJ IDEA, on which Android Studio was based) and had reached version 1.0 in February 2016 after years of development that started in 2010. The announcement included immediate support in Android Studio 3.0 (released October 2017) — Kotlin tooling was built into the IDE at the same level as Java, with full debugging support, code completion, refactoring, and a Java-to-Kotlin converter that could automatically translate existing Java files. Kotlin compiled to JVM bytecode (like Java), meaning Kotlin and Java source files in the same project compiled to interchangeable .class files, and Kotlin code could directly call Java APIs and vice versa — including the entire Android SDK (android.app.Activity, android.widget., android.content.), all Jetpack libraries, and any Java library in Maven Central.
Kotlin addressed the most common Java pain points in Android development: null safety (the type system distinguished String from String?, preventing NullPointerException at compile time rather than runtime — NPEs were the top cause of Android app crashes), data classes (data class User(val name: String, val age: Int) auto-generated equals(), hashCode(), toString(), copy(), and destructuring), extension functions (fun String.isPalindrome(): Boolean added methods to existing classes without inheritance), concise lambda syntax with SAM (Single Abstract Method) conversion (button.setOnClickListener { startActivity(intent) } vs Java’s anonymous class), and coroutines — Kotlin’s structured concurrency model (stable in Kotlin 1.3, October 2018) that expressed async operations sequentially using suspend functions and launch/async coroutine builders, replacing Android’s callback-heavy AsyncTask and the RxJava reactive streams pattern for most use cases. Coroutines integrated with Android’s lifecycle-aware viewModelScope and lifecycleScope (Jetpack Lifecycle 2.2, January 2020), automatically cancelling background work when the associated lifecycle ended.
Google escalated the commitment in May 2019 at I/O: Kotlin was declared the preferred language for Android development (“Kotlin-first”), meaning new Android API samples, documentation, and Jetpack library development would be written in Kotlin first and Java second. Jetpack Compose (stable July 2021) — the modern declarative UI toolkit that replaced Android’s XML View system — was designed exclusively in Kotlin using a Kotlin compiler plugin (the Compose compiler, which transformed @Composable functions at compile time into the Compose runtime’s node tree), making Kotlin a hard requirement for using the new UI toolkit rather than a preference. By 2020, approximately 70% of the top 1,000 Android apps in the Google Play Store used Kotlin for at least some of their code. KSP (Kotlin Symbol Processing, stable 2021) replaced the slower KAPT (Kotlin Annotation Processing Tool) for compile-time code generation used by Room, Dagger/Hilt, and other annotation-based libraries, completing Kotlin’s integration into Android’s build and tooling ecosystem.
