explaingit

kotlin/anko

15,791KotlinAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

Deprecated Kotlin library that let Android developers build UIs, run SQLite queries, and use coroutines directly in Kotlin code instead of XML.

Mindmap

mindmap
  root((anko))
    Status
      Deprecated
      Archived for reference
    Components
      Anko Commons
      Anko Layouts
      Anko SQLite
      Anko Coroutines
    Use Cases
      Build Android UI in Kotlin
      Show dialogs and toasts
      Query SQLite without boilerplate
    Tech Stack
      Kotlin
      Android SDK
      Gradle
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Read legacy Android code that uses Anko DSL layouts

USE CASE 2

Migrate an old Anko-based app to Jetpack Compose or View Binding

USE CASE 3

Study how a Kotlin DSL for Android UIs was structured

Tech stack

KotlinAndroidGradle

Getting it running

Difficulty · moderate Time to first run · 1h+

Library is deprecated and may not work with current Android Gradle Plugin or Kotlin versions.

Apache 2.0 lets you use, modify, and ship it commercially as long as you keep the license notice and patent grant.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me how to replace an Anko verticalLayout block with Jetpack Compose equivalents
Prompt 2
Convert this Anko SQLite query to Room and explain the mapping step by step
Prompt 3
Rewrite an Anko Commons toast and dialog snippet using current AndroidX APIs
Prompt 4
List every Anko Coroutines pattern in this file and give me the modern kotlinx.coroutines version
Open on GitHub → Explain another repo

← kotlin on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.