Android Dagger 2

Dagger 1 to 2 migration process

Dependency injection frameworks in Android – is there anyone who has never heard about it? At almost every Android dev conference someone talks about this software design pattern. I am a big fan of DI but there are also people who complain about it. The main reasons why they do this are:

  • dependency injection frameworks are slow – well, it was completely true a couple years ago in times of RoboGuice, when the whole dependency graph were created and validated in runtime. Now, when we have Dagger it’s not (completely) true. In Dagger 1 much of work (graph validation) is done in compilation time and objects creation process is done without reflection (it’s worth mentioning that recently presented Roboguice 3 also does much of his work in compile-time). Yes, it’s still a bit slower than hand-written code, but in average Android app it is almost imperceptible.
  • DI frameworks requires a lot of boilerplate – it is true and it isn’t. Yes, we have to create additional code for injections, classes which provides dependencies etc. but thanks to them we don’t have to deal with objects constructors every time when we need them. Yes, in small projects DI frameworks are overkill, but benefits of dependency injection increase when you start dealing with scale.
  • Other stuff like poor traceability, hard to read generated code etc.
Android User Interface

Instagram with Material Design concept is getting real – The Summary

This is just a summary of series of posts showing Android implementation of INSTAGRAM with Material Design concept. If you read previous posts about InstaMaterial project, you can skip this one.

A couple months ago I started to work on project which implements almost all visual effects showed in the video created by designer Emmanuel Pacamalan. This video presents new Google design guidelines – Material Design. Everything looked great, but some people started to worry about the bigges problem of Android platform – fragmentation. Material Design was presented with the newest Android system – 5.0 Lollipop which adoption rate looks like below:

Android Statistics

Still less than 5% at this moment (first half of March 2015). Not so good, right?

Android User Interface

InstaMaterial concept (part 9) – Photo publishing

This post is the last part of a series of posts showing Android implementation of INSTAGRAM with Material Design concept. Today we’ll finally finish our project by creating the last elements – PublishActivity and SendingProgressView. This functionality is presented between the 41st and 49th second of the concept video.

APK file which has been built from code described in today’s post is available here. Yes, this is the final version of InstaMaterial. 😄

Here is the final effect implemented in this post (video which presents the whole project will be shown in next, the summary post):