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.
- Host: GitHub
- URL: https://github.com/albert-gao/daggerandroidkotlinexample
- Owner: Albert-Gao
- Created: 2018-04-18T01:07:53.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T05:32:22.000Z (almost 8 years ago)
- Last Synced: 2025-03-28T14:11:08.287Z (10 months ago)
- Topics: android, dagger, dagger-android, dependency-injection, example
- Language: Kotlin
- Homepage:
- Size: 133 KB
- Stars: 15
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/)