Happy Birthday AndroidAnnotations!

Two years ago, I created AndroidAnnotations.

First commit

Lesson n°1: think before writing your first commit message

Time to take a look back at the last two years!

Warning!

This article contains trivia, useless statistics, and too much me and I.
You have been warned.

@Background

I started writing Android apps in 2009. I came from the Java/JEE world, in which you can find tons of frameworks and good practices. Android didn't feel right: my whole codebase was tied to the Activity class, and I didn't find the code to be much readable and maintainable.

I wanted to decouple my code components using IoC & Dependency Injection, so I tried a few things:

  • Spring IoC, which relied on JDK classes not available in Android, and crashed.
  • Creating the dependency graph manually, in code. Worked great, until the dependency graph became too big and hard to maintain.
  • Creating a small DI container that didn't rely on reflection. It wasn't typesafe though, and it required tons of anonymous classes.

Then I discovered RoboGuice, started using it and contributing. I really liked that you could inject Android specific components such as views and resource. This isn't really dependency injection, but it still makes your code much more readable. The bad part though was the performance hit on startup, because RoboGuice relied on reflection.

On the 14th of december 2010, Olivier Croisier presented the Annotation Processors at the ParisJUG. A few days later, AndroidAnnotations was born.

The name AndroidAnnotations comes from the AndroidAnnotationProcessor class that handles the annotation processing.

The focus in AndroidAnnotations has never really been about dependency injection, but rather about creating annotations to simplify your code and make your life easier, at compile time. It started with view injection, then event binding (based on GWT @UiHandler), resource injection, simplified threading…

AndroidAnnotations logo

@Timeline

  • December 2010 First commit

  • January 2011 First external code contribution

  • April 2011 Release of the 2.0 version

  • August 2011 Roy Clarkson mentions AndroidAnnotations on the SpringSource Blog

  • September 2011 eBusiness Information becomes the official sponsor

  • October 2011 Matthias Kaeppler mentions AndroidAnnotations at DroidCon London 2011

  • January 2012 Migration from Google Code to GitHub

  • April 2012 Talk at Devoxx France

  • October 2012 Talk at Devoxx

Diet Driven Development

@RandomStats

@Future

AndroidAnnotations will continue to concentrate on simplifying your Android code with compile time code generation. I think Android developers should be able to pickup their frameworks of choice and use them all together.

Here is a sample project that uses Dagger for dependency injection, AndroidAnnotations for boilerplate removal, and Otto as an event bus.

Let's see what happens over the next two years!

Comments