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
9
votes
1 answer

roboblender-3.0.1.jar: not included in Android: javax.tools. Referenced from com.google.inject.blender.AnnotationDatabaseGenerator

I try to build my android project and I get: Information:Gradle: Executing tasks: [clean, :app:compileDebugSources] Information:1/10/15, 11:13 AM - Compilation completed successfully in 5 sec I then try to deploy it to my device and get: FAILURE:…
Elad Benda2
  • 13,852
  • 29
  • 82
  • 157
8
votes
3 answers

What makes Guice unable to run on Android except as Guice-no-aop?

I see on Guice's download page a module called guice-no-aop, whose intention is clearly marketing towards Android developers. Several online searches pulled back libraries like RoboGuice that look like they do similar AOP-based IoC, and several…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
8
votes
1 answer

Injectview (Roboguice) not working with multiple layouts

So I have different layouts for this one Activity. And I have different classes that each open and do their thing with a layout. I inject these classes in the Activity via @Inject. All this is without problem. But when I try to use @InjectView on…
chrissie1
  • 5,014
  • 3
  • 26
  • 26
8
votes
4 answers

ORMLite for Android: Bind DAO with Roboguice

I'm just trying to setup my Android Project with ORMLite. I'm using Roboguice for DI. Now my question is, whether anyone here can help getting those working together. I've setup my helper class extending OrmLiteSqliteOpenHelper. Now I'm wondering…
Sam7
  • 3,382
  • 2
  • 34
  • 57
8
votes
2 answers

java.lang.ClassCastException: android.app.Application cannot be cast to roboguice.application.RoboApplication

example using roboguice. This code get ClassCastException. public class MainActivity extends RoboActivity{ @InjectView(R.id.text) TextView name; @InjectView(R.id.imageView1) ImageView imageView; Drawable icon; …
Sagar Vaghela
  • 1,165
  • 5
  • 20
  • 38
7
votes
1 answer

Mocking SQLite-Database while testing Activity with Robolectric

In the past few days I started playing around with roboguice, robolectric and mockito. I have a small Android-application with a login-screen containing an AutoCompleteTextView for faster entering the username. The usernames for the…
Frank
  • 113
  • 2
  • 10
7
votes
2 answers

Deserializing a Generic Type with Jackson

I am trying to make a class that uses the Jackson to deserialize POJO's. It looks like this... public class DeserialiserImp implements Deserialiser { protected ObjectMapper objectMapper = new ObjectMapper(); @Override …
jiduvah
  • 5,108
  • 6
  • 39
  • 55
7
votes
2 answers

Android - Setting up Roboguice 2.0?

I started a new project (In Eclipse classic), added roboguice-2.0.jar guice-2.0-no-aop.jar and jsr305-1.3.9.jar to my project and my build path. The first step is to extend RoboApplication, but eclipse cannot find the matching package for this…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
6
votes
2 answers

attempting to unit test and something with RoboGuice.newDefaultRoboModule() is failing with Roboguice 2.0b3 and Robolectric

I've been looking at the astroboy example code and documentation for RoboGuice 2, and I'm honestly stumped. I hope you all can help me out with things to try. The goal here is to test the module to make sure it's loading and that the IoC is working…
6
votes
5 answers

RoboGuice 3.0 NoClassDefFoundError: AnnotationDatabaseImpl

For some reason the RoboBlender does not generate the annotation database. My build.gradle has the following dependencies: dependencies { provided 'org.roboguice:roboblender:3.0' compile fileTree(dir: 'libs', include: ['*.jar']) compile…
jush
  • 613
  • 5
  • 13
6
votes
1 answer

Inject object Resources in Class Util (using Dagger)

I some time testing some things with Dagger, after overseeing the series of articles here: http://antonioleiva.com/dependency-injection-android-dagger-part-1/, went back for more information, I saw some good examples like these:…
Anderson K
  • 5,445
  • 5
  • 35
  • 50
6
votes
2 answers

Gradle and multiple projects with Roboguice dependency

I'm trying to migrate an old IntelliJ project to use gradle. However, assembleDebug fails during the dx step: java.lang.IllegalArgumentException: already added: Lcom/google/inject/AbstractModule; at…
Hrushikesh
  • 327
  • 3
  • 6
6
votes
1 answer

Using RoboFragment with FragmentManager

I've been trying to use RoboGuice and fragments with no luck. I have a fragment that extends RoboFragment, and an activity that extends RoboActivity, but it seems that within the RoboActivity, the method getFragmentManager is incompatible with…
Matt Whetton
  • 6,616
  • 5
  • 36
  • 57
6
votes
2 answers

InjectView in RoboFragment

I want to inject some views from an xml layout to a RoboFragment but unfortunately I am getting Nullpointer Exception. Since RoboGuice (besides being a great DI framework) has very little documentation, I don't know if I can use…
Thomas Kaliakos
  • 3,274
  • 4
  • 25
  • 39
6
votes
2 answers

Android app with RoboGuice 2.0 - How to inject a Singleton with the Application context

I have a GameStateManager singleton that I want to have available to all of my activities. In particular I want it to listen for Events fired off with the EventManager using the Application Context instead of an individual Activity…
Erds
  • 513
  • 5
  • 16
1
2
3
21 22