Kotlin has been gaining momentum in becoming a main language to develop Android app. Kotlin already works well with third party libraries which are developed in Java. This post will focus on the best libraries written for Kotlin.
Kodein is a very simple and easy-to-use dependency retrieval container. Kodein allows you to lazily instantiate your dependencies when needed, easily bind classes or interfaces to their instance or provider, forgetting about dependency initialization order, and easily debug your dependency bindings and recursions.
MapMe is a library written in Kotlin. It supports both Google Maps and Mapbox. MapMe brings the adapter pattern to Maps, and makes markers and annotations management easier.
The library will help you writing Kotlin codes for Android faster and cleaner. Anko consists of 4 components:
- Anko Commons contains helpers for intents, dialogs, logging and more.
- Anko Layouts is a fast and type-safe way to write dynamic Android layouts.
- Anko SQLite is a query DSL and parser collection for Android SQLite.
- Anko Coroutines helps write coroutines based on the kotlinx.coroutines library.
This is similar to Java Poet but dedicates to Kotlin. The library can generate .kt source files using code.
KAndroid providing useful extensions to reduce boilerplate code in Android SDK such as using Toast, Intents, system services and views.
LastAdapter is the first RecyclerView adapter library written in Kotlin. Using this library will help you skip writing adapter and even ViewHolder.
This library will help creating Navigation Drawer without touching XML. Drawer’s elements such as menu items, badges, account headers, can be accessed via code.
It is a wrapper for Android SharedPreference.
Kovenant is an easy asynchronous library for Kotlin. It has extensions for Android, RxJava, JavaFX and many more.
PaperParcel is an Android Parcelable boilerplate annotation processor which automatically generates the CREATOR and writeToParcel(…) implementations.
This is a type-safe time class. You can call time interval easily using Kotlin’s extension functions such as 10.seconds for 10 seconds, 2.hours for 2 hours. They can also be used in calculation like 15.minutes + 10.seconds – 5.minutes + 5.hours.