anko
Pleasant Android application development
Deprecated Kotlin library that let Android developers build UIs, run SQLite queries, and use coroutines directly in Kotlin code instead of XML.
Anko is a deprecated Kotlin library that was designed to make Android app development faster and more readable. It is no longer maintained and the README links to a farewell page explaining its discontinuation. This description covers what it was.
Android apps have traditionally used XML files to define their user interfaces — separate files describing layouts, buttons, and text fields. Anko offered an alternative: write your UI directly in Kotlin code using a DSL (domain-specific language), a special syntax that reads almost like plain English. For example, a vertical column containing a text input and a button could be written in just a few lines of Kotlin, with no XML required.
Beyond layouts, Anko consisted of four components. Anko Commons provided shortcut functions for common tasks like showing dialog popups, writing log messages, and navigating between screens. Anko SQLite made it easier to query Android's built-in SQLite database (a local data storage system) without writing repetitive boilerplate code. Anko Layouts was the DSL for building UIs in code. Anko Coroutines helped with running code asynchronously — doing work in the background without freezing the UI — using Kotlin's coroutines feature.
Because Anko is deprecated, new Android projects should not use it. Developers who worked with it in the past may find this repository useful for reference, but for active development the Kotlin and Android teams have recommended other approaches for each of these areas.
Where it fits
- Read legacy Android code that uses Anko DSL layouts
- Migrate an old Anko-based app to Jetpack Compose or View Binding
- Study how a Kotlin DSL for Android UIs was structured