Let’s play with different configurations and tests… in a multi-module app.

It has been 18 months since I published the first part of this post. That first part was about using dagger in different configurations and an easy playground app to play with:

Some months ago I added a new configuration with support for injection in a module, but with limited capabilities. Those configurations are implemented as different branches of the same repo in Github:

Avoid graphical glitches by modifying specific ViewHolder items without redrawing them.

Showing information in a list, or a set of cards is probably the most commonly used graphical widget in any app. The process we usually follow is:

DiffUtil is a great improvement over the old notifyDataSetChanged

Use DI even in your spike projects.

All of us create spike projects with only one or two classes in order to test a new functionality. In those case we tend to avoid using Dagger 2 because it takes too long to make its initial configuration.

Some mates have commented me that Dagger 2 is too complex and it doesn’t make sense to include it in small Kotlin projects cause Kotlin’s powerful constructors.

But, what if we could use JSR330 annotations with only a 4 lines interface configuration?

interface DiComponent {
fun inject(activity: MainActivity)

This is all we…

Let’s play with different configurations and tests.

Update: There is a second part of this post: Let’s play with different configurations and tests… in a multi-module app

Recently I came across Android injectors for Dagger 2. As I have always used dependent components in my Dagger configurations and only sometimes Subcomponents, I decided to create a small pet project where every possibility is tried.

I won’t explain here how Dagger 2 works or the different configurations we can use, There are plenty of posts about it, the idea of this post is to provide a repository to play with.

Specifically I wanted a project with:

Network awareness using LiveData

The most exciting thing I got from latest 2017 Google I/O was the inclusion of Kotlin as officially supported language in Android. And the second one was the presentation of Android Architecture Components.

One of the subjects with more hype in Android during last years has been Clean Architecture. Different architectures has been discussed in forums, lectures and blogs. MVP, Hexagonal, MVVM… Can you see the issue here? Architecture fragmentation :)

Android Architecture Components are a well-thought, although still in Alpha stage, way of create applications in Android. Google recognizes that this is not the only correct way of doing…

Miguel J. Sesma

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store