Koin
Koin is a lighter framework that is suitable for smaller apps. It requires no code generation and is built based on Kotlin’s functional extensions. It is also a domain-specific language (DSL). You may have noticed that when using Dagger, a lot of code must be written to set up the DI. Koin’s approach to DI solves most of those issues, allowing faster integration.
Koin can be added to your project by adding the following dependency to your build.gradle
file:
implementation "io.insert-koin:koin-core:3.2.2"
To set up Koin in your application, you need the startKoin
call with the DSL syntax:
class MyApplication : Application() { override fun onCreate() { super.onCreate() startKoin { androidLogger(Level.INFO) ...