0

Do you have a simple example of DI built on Gradle? I need to see setter injection used to express an optional dependecy, just as per the standard design pattern. Thank you

EDIT To better define the context of the Q... I already have my apk -OpenTweetSearch- on Google Play https://play.google.com/store/apps/details?id=org.new_year

I would like to integrate my Twitter OAuth 2.0 with Google Drive SDK OAuth 2.0. I've found here the Gradle dependencies of Google Drive SDK: https://gist.github.com/johnscheible/5994719 There is an exclusion of transitive dependencies. "However, exclude feels like the sort of thing that an app developer might need but that ideally is avoided" (see Gradle for Android, AARs, and Conditional Dependencies). That's why am asking for code example of gradle and dependency injection in the context of Google Drive SDK: is would suffice also and example in c# .net WPF to help me. In any case the code example is not the main point of my question and you could answer without any code examples: in fact a Design Pattern is something you should discuss before code implementation and it should be managed in a layer of abstraction separate from the layer of the building system. So I fail to understand why my Q is put on hold for a secondary point that is not the focus of my Q.

Community
  • 1
  • 1

1 Answers1

4

I am Frank Du mentioned above. Thank you for checking my older blog. In fact, I've already adopted a new method, which is simpler and better.

The link has motivated me to share my android + gradle + dagger setup. Of coz I learned the tips from many sources, as I said in my blog. The github project covers quite a few topics, such as aar dependencies, module reuse, dagger code gen, etc. Here are the links:

  1. Check out the source codes: https://github.com/frankdu/android-gradle-dagger-tutorial
  2. The blog post: http://www.frankdu.com/blog/2014/01/18/tutorial-create-android-gradle-project-with-dagger/

So, hope it helps!

Frank Du
  • 516
  • 4
  • 12
  • Even better. I learned more things at https://plus.google.com/+FrankDU3/posts/Vh4LWthj1Gp, and the github repo is updated. :-) – Frank Du Jan 20 '14 at 06:57