Koin Android Developer Guide

Guide for using Koin for your daily Android development

Work in Progress …

You are working with Koin and modules, but not so easy to figure out how to use properly Koin DSL? When and how to use context? Bean or Factory? This page will give you the needed answers.

Our usecase

// Koin module
val myModule : Module = applicationContext {
    provide { MyPresenter(get()) } // get() will resolve Repository instance
    provide { MyRepository() as Repository }

Android injection strategies

MVP Style binding

Factory or Singleton

Shared components & Context

Android Architecture Lifecycle & ViewModel

Shared ViewModel