Android KTX: A dash of Kotlin makes all the difference! (KotlinConf 2018)

1b4a6c2e7bafdb5c945865dac35a9eb3?s=47 Dan Kim
October 05, 2018

Android KTX: A dash of Kotlin makes all the difference! (KotlinConf 2018)

When Kotlin hit the Android scene, one of the first things many of us did was wrap difficult-to-use Android Framework APIs with extension functions. That little sprinkle of Kotlin made all the difference, and life was great — we finally we had a way to make our least favorite calls more concise and easier to work with!

Android KTX builds on this same idea and makes them available to everyone. It's a new set of open source Kotlin extensions (maintained by Google) that sits on top of commonly used Framework methods, abstracting much of the complexity and boilerplate away. This vastly improves the conciseness and readability of your code, making it more idiomatic and enjoyable to work with.

In this talk we'll start with a brief intro to KTX — what it is, why it's so great, and what it means for us as Android developers. Next we'll take a tour of what extensions are currently available, highlighting some of my favorites. We'll compare the old, hard ways of doing things against the new, friendlier ways that KTX provides so you can clearly see how life with KTX is better!

By the end you’ll have a better idea of 1) how you can improve your Android code by using KTX in your daily work and 2) what well-designed extension methods look like so you can wrap/extend the Android framework for your own use (or to contribute back into KTX!)


Dan Kim

October 05, 2018