Kotlin is becoming the most popular language for developers. Currently, Android Kotlin libraries are one of the hottest topics for all Android developers. Each developer wants to know about android libraries.
Kodein we use for Dependency-Injection. Kodein is simple, easy to use and easily configured dependency.
- Anko Layout
- Anko Commons
- Anko SQLite
- Anko Coroutines
You can read more about these parts here.
KBinding is used for data binding. KBinding framework is base on Anko, simple and powerful. It only library that enables you to bind the data of your model directly to the XML views in a very flexible way.
KBinding has following four binding modes
- One Way – Binding from model to view
- Two Way – Binding from model to view and view to model
- One Way To Source – Binding from view to model
- One Time – Binding from model to view and auto release after first emitting.
Klaxon library we used for JSON parsing. It is lightweight and easy to use for developers. You can cast it any type once parsed. You can parse valid JSON file into following types
- JSON Object
- JSON Array
KAndroid library we used to eliminate boilerplate code. By using this library, you don’t need to write much code for common function. By using this library, you can take huge help in the following functions.
- Handler Implementation.
- Search view query text change.
- Text Watcher.
- Seek bar extension.
- Android Services.
- Loading Animations etc.
RxKotlin is an extremely lightweight library mentioned in this article. You can use RxJava with Kotlin out-of-the-box. Kotlin has language features like extension function which will streamline using RxJava even more.
If you want to design a flexible layout in your application, then the Flexbox Layout is the best option for you. This library brings similar capabilities of the CSS Flexible Box Layout Module to Android. You can use FlexboxLayout in two ways.
FlexboxLayout extends the classes of ViewGroups like Linear Layout and Relative layout.
FlexboxLayoutManager you can use it for RecyclerView.
FlexboxLayout has the following attributes
- Flex Direction
- Flex Wrap
- Justify Content
- Align Items
- Align Contents
Attributes for the children of FlexboxLayout.
- Layout Order
- Layout Flex Grow
- Layout Flex Shrink
- Layout Align Self
- Layout Flex Basis Percent
- Layout Max Width/Height
- Layout Wrap Before
9- Kotlin Coroutines:
When we are working on long-running operations such as IO, Network, Thread, and FileIO, etc. Then we require a code that makes it easier, faster and easy to read. The code reduces boilerplate code in our project. For this kind of operation, we use Kotlin Coroutines. Kotlin Coroutines is the best way to avoid blocking a thread and replace it with a more controllable operation.
Kotlin Coroutines it allowed the developer to develop asynchronous programs in a very simple way.
Instead of wasting your energy and time on something for example configuration which has no business value focus on what really matters.
By using Ktlint, you put the importance of code clarity and community conventions over personal preferences. This makes things easier for people reading your code as well as free you from having to document & explain what style potential contributor has to follow (Github )