An open API service indexing awesome lists of open source software.

https://github.com/albert-gao/daggerandroidkotlinexample

A minimal setup for using dagger-android with Kotlin to setup application wide and activity wide dependencies.
https://github.com/albert-gao/daggerandroidkotlinexample

android dagger dagger-android dependency-injection example

Last synced: 9 months ago
JSON representation

A minimal setup for using dagger-android with Kotlin to setup application wide and activity wide dependencies.

Awesome Lists containing this project

README

          

# DaggerAndroidKotlinExample

## About this repo

- A minimal setup for using `dagger-android` with Kotlin to setup application wide and activity wide dependencies can be found in the master branch.
- Check my [blog](http://www.albertgao.xyz/2018/04/18/dependency-injection-on-android-with-dagger-android-and-kotlin/) for more details

## How to test

- See the [`withTest`](https://github.com/Albert-Gao/DaggerAndroidKotlinExample/tree/withTest) branch
- A repo for demo how to mock the dagger-android injection when doing `Espresso` `instrumented test`.
- Check my [blog](http://www.albertgao.xyz/2018/04/24/how-to-mock-dagger-android-injection-in-instrumented-tests-with-kotlin/) for more details

## A good start

**If you feel this setup is overwhelming, do check the below one with plain dagger 2, should be much simpler:**

- [repo](https://github.com/Albert-Gao/PlainDaggerKotlinAndroid)
- [blog](http://www.albertgao.xyz/2018/04/17/dependency-injection-on-android-using-dagger-and-kotlin-in-minutes/)