Questions tagged [roboguice]

Roboguice brings the power and testability of using the Google Guice dependency injection framework to Android application development.

RoboGuice is a framework that brings the simplicity and ease of Dependency Injection to Android, using Google's own Guice library.

Useful links

329 questions
3
votes
3 answers

Roboguice, ADT 14+, and Android library projects

Roboguice is such a neat little tool to tidy up boilerplate Android view code. I loved using the @InjectView annotation so that I didn't have to initialize each and every view field in the onCreate() method of my Activities like…
Jonathan Schneider
  • 26,852
  • 13
  • 75
  • 99
3
votes
2 answers

How to inject context using RoboGuice in Android?

I would like to inject my context to my Utility classes, I have seen examples using Static fields, Are there any ways to do it with out static fields?
iraSenthil
  • 11,307
  • 6
  • 39
  • 49
3
votes
1 answer

Roboguice @Inject service confusion

private Service service; @Inject public ClassName(final Service service) { this.service = service; } @Inject private Service service; Could someone please tell me the difference between this 2 styles of injection?
3
votes
1 answer

Is RoboGuice wiki obsolete ? setBaseApplicationInjector does not exist?

I am trying to use the last version to date (3.0.1) of RoboGuice on my new Android application using Android Studio 1.5 (stable). Long ago, I dealt with Guice & RoboGuice but I took on some reading on how to use Roboguice with new improvements &…
Mackovich
  • 3,319
  • 6
  • 35
  • 73
3
votes
0 answers

Attribute values must be constant while injecting views with RoboGuice

I have a project contains 2 applications and 1 library module. I would like to use RoboGuice because of the view injection feature. Currently i cannot inject views in my library module, because generated ids in the R.java file are not constants and…
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
3
votes
3 answers

RoboGuice: Using full reflection. Try using RoboGuice annotation processor for better performance

When I start my RoboGuice android app, the following message appears in logs: roboguice.RoboGuice﹕ Using full reflection. Try using RoboGuice annotation processor for better performance. What does it means? All my activities (including my…
Antonio
  • 11,413
  • 6
  • 34
  • 48
3
votes
2 answers

Roboblender use annotation databases with multiple modules

I'm following the steps from the RoboBlender Wiki to use annotations database but I keep getting java.lang.IllegalStateException: Unable to use annotation database(s) because it cannot find AnnotationDatabaseImpl I am using Android Studio and…
3
votes
2 answers

Cannot inject view to custom class with RoboGuice

I started to use RoboGuice within my project. I can easily inject views inside fragments and activites but i have some trouble with cusom views. I got null ptr exception every time. According to RoboGuice's example i did the same with my custom…
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
3
votes
1 answer

Binding annotation @InjectView without @Inject declared warning

I got this warning in my project. I'm learning to use IntelliJ IDEA as my IDE. Here's the code with warnings: @InjectView(R.id.button) private Button loginBtn; The full messages are as follows: Binding annotation @InjectView(R.id.button) without…
Kimi Chiu
  • 2,103
  • 3
  • 22
  • 37
3
votes
0 answers

Roboguice java.lang.NoClassDefFoundError

When i run my espresso test on the main activity i get this error and i can't run the test. Has anyone run into a similar issue it seems to fail on super.onCreate(savedInstanceState); but not sure why not even using roboguice at that line of…
user1408682
  • 409
  • 2
  • 8
  • 23
3
votes
3 answers

Gradle project does not build when I add RoboBlender

I have added RoboGuice 3 dependency into my gradle build file it compiles and runs, however the application crashes because of NoClassDefFoundError: AnnotationDatabaseImpl. Did some research that suggested that RoboBlender was necessary to generate…
user2054833
  • 2,115
  • 7
  • 24
  • 39
3
votes
2 answers

RoboGuice with Standard Android JUnit test cases

I want to use RoboGuice in a standard Android JUnit instrumentation test case and override one piece of my app's actual wiring with a mock for testing. I can't find anything online that explains how to do this as all of my search results go to…
Cliff
  • 10,586
  • 7
  • 61
  • 102
3
votes
1 answer

How does RoboGuice know what i mean to inject?

I am using RoboGuice 4.0beta2 , and i have this problem I have several different objects that implement the same interface call them A implements ITest B implements ITest C implements ITest I have class D, that uses all 3 implementations together,…
Lena Bru
  • 13,521
  • 11
  • 61
  • 126
3
votes
1 answer

Adding Test Module for RoboGuice When Using Robolectric 2

I am currently upgrading robolectric from version 1 to 2. In my current version I use the following to provide the test module (for binding) to roboguice. public class RoboTestRunner extends RobolectricTestRunner { public…
jiduvah
  • 5,108
  • 6
  • 39
  • 55
3
votes
1 answer

Maven Eclipse Plugin won't add Android support-v4 to build path

I'm working on a project using RoboGuice with Eclipse ADT, m2e and android-maven-plugin. I'm using RoboListFragment class which depends on android.support.v4.app.ListFragment, for this reason I've added the following dependency to…