Saturday, August 27, 2011

Using dependency injection and annotations in Android for cleaner code

Interesting overview of possibilities for cleaner code using dependency injection and annotations by using the RoboGuice and/or


Android Annotations


frameworks:

Clean code in Android applications

Definitely interesting possibilities, but these frameworks are quite young. And is it really worth the effort, since Activities and Intents can also be used quite effectively to keep the app loosely-coupled? Also the libraries will increase the app's size.

Not convinced yet :)

3 comments:

Piwaï said...

Well, AndroidAnnotations adds a 40Kb API jar.. but that's all :-) . The other jar, probably a big one, is the annotation processor, which generates code that you'd otherwise write (so that's about the same quantity of code). The "big jar" won't be part of your APK ;-)

Techie said...

@Piwai Thanks for the clarification!

Surendraece08 said...

RoboGuice is one of the advanced concepts of Android app development in Java. RoboGuice allows Dependency Injection very easily.