Category Archives: Koin

Koin is a pragmatic lightweight dependency injection framework for Kotlin developers. Written in pure Kotlin using functional resolution only: no proxy, no code generation, no reflection!

Version 2.0 was recently released, but it’s still a bit tricky to find all the information in one place. Below you can find instructions for setting up Koin 2.0.1 with Android Kotlin projects.

Dependency Injection (DI) is one of those “new” concepts that keeps showing up in every blog post on the Internet. In fact, the idea is not new, but a notion that gets revisited from time to time. Mastering DI will allow you to handle large and complex applications in a more convenient way.

Koin – Add ViewModel module

In the very last chapter we have refactored our code to use the Koin library. We have added a module, where we have set the data classes. Then we have created an application wide class, and finally we have refactored the viewmodel. So from now it contains less code then before. In this chapter we will create a module for the ViewModel as well.
The ViewModel class is designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations. (Android Developer: ViewModel Overview)

Continue reading Koin – Add ViewModel module

Follow and like us:

Koin – Add Koin library

In the previous chapter of the tutorial you could read what is Koin and about what does Dependency Injection mean. After this we were talking about the project, about a simple burger ordering app.

In this application we can add a burger and a mineral water to our orderlist. It is very simple. In this chapter we are going to add to this project the Koin library.

Let’s start coding. 😉

Continue reading Koin – Add Koin library

Follow and like us:

Koin – Introduction

In the introduction part of the tutorial, we will get to know Koin, a Dependency Injection (DI) framework. We will build up for this a simple ordering app. First without any DI, than we gonna modify it to use Koin.

Koin is a dependency injection framework for Android and Kotlin developers.

It is written completely in Kotlin, that’s why it is efficient and lightweight. It has also a very good support for Android.

Continue reading Koin – Introduction

Follow and like us: