Android ViewModel injection with Dagger

Aleksandrs Orlovs
Chili Labs

--

ViewModel from Android Architecture Components is a long-awaited solution from Google to address android application architecture, and it packs some really nice features too. A fine new addition to the set of essential android development tools that we use here at Chili (alongside Dagger, RxJava, Data Binding Library). But making the new kid to play nice with the others is not always as easy as it seems.

The structure of this article reflects my thought process (with questions and ideas that arose along the way) and results in a final solution of how to make ViewModel work well with dependency injection using Dagger.

You should be familiar with Dagger for Android to understand the basic setup and some behind the scenes actions… read full article on chililabs.io

--

--