OpenRadar

Project · Kotlin · Added September 10, 2024

ktx

A collection of Kotlin extensions for Android development that makes working with Android APIs more idiomatic, concise, and pleasant. Maintained by the Android team at Google.

7,800 stars 620 forks View on GitHub

Android KTX

Android KTX is a set of Kotlin extensions that wraps Android framework APIs to be more concise and idiomatic to use from Kotlin. It doesn’t add new functionality — it makes existing APIs nicer to use.

Why it matters

Android’s Java APIs predate Kotlin’s modern language features. KTX bridges that gap with extension functions, lambdas, named parameters, and default arguments that make Android development feel natural in Kotlin.

Key Modules

Example

// Before KTX
sharedPreferences.edit().putString("key", "value").apply()

// With KTX
sharedPreferences.edit { putString("key", "value") }

Language & Stack

Kotlin · Apache 2.0 License · Maintained by Google