How do you override a module/dependency in a unit test with Dagger 2.0?

Probably this is more a workaround that proper support for test module overriding, but it allows to override production modules with test one. The code snippets below shows simple case when you have just one component and one module, but this should work for any scenario. It requires a lot of boilerplate and code repetition … Read more

How to set up DAGGER dependency injection from scratch in Android project?

Guide for Dagger 2.x (Revised Edition 6): The steps are the following: 1.) add Dagger to your build.gradle files: top level build.gradle: . // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath ‘com.android.tools.build:gradle:2.2.0’ classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ //added apt for source code generation … Read more

tech