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

How to optimize Roboguice apps to start faster?

Background I have to use Roboguice for an app, which handles a lot of injections on many classes. The app also has a splash screen class which extends from RoboSplashActivity . The problem As the app got more and more complex, more time was spent on…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
3
votes
1 answer

How to inject dependencies into a Robolectric Test-class using RoboGuice

I want to start using Robolectric and RoboGuice in my Android-Apps. While I make satisfactory progress using Robolectric I am stuck using RoboGuice. I created a small Android-App for experimenting. It is only one Activity, injecting a Button and…
Frank
  • 113
  • 2
  • 10
3
votes
2 answers

How can I inject parameter through constructor in Roboguice? [android]

This question is probably exact duplicate of this one Pass parameter to constructor with Guice Difference is that I use roboguice for android, not just Guice, so answers there does not work for me. Question is - how can I pass initialize parameters…
Vitalii Korsakov
  • 45,737
  • 20
  • 72
  • 90
3
votes
1 answer

RoboGuice 2.0 and Robolectric 1.1 Testing RoboAsyncTask

I am currently using both RoboGuice 2.0 and Robolectric 1.1 in my Android application. I've noticed that the RoboLooperThread is gone in 2.0 and I'm having difficulties having any RoboAsyncTask's be invoked. When the main test thread calls…
vincentjames501
  • 2,131
  • 1
  • 13
  • 7
3
votes
2 answers

How to work with context singletons in Roboguice

I'm using @ContextSingleton to mark singletons that depend on the injection on contexts. From looking at RoboGuice sources and from my own tests it seems however as if it makes a difference between the Application context and different activity…
Thomas Keller
  • 5,933
  • 6
  • 48
  • 80
3
votes
1 answer

Roboguice creates its own Application class instance

I'm using Roboguice for DI in my project. As per android documentation only one instance of application can exists. But instances which crated by OS and by Roboguice is different. How to force Roboguice inject application created by OS and disable…
Dmitriy Tarasov
  • 1,949
  • 20
  • 37
3
votes
1 answer

Injected fields null in RoboGuice 2.0

I'm new to Roboguice, and I'd like to use it in my new Android application. I have a test Activity that extends RoboActivity. public class MainActivity extends RoboActivity { @Inject private TestService testService; .... } And…
gipinani
  • 14,038
  • 12
  • 56
  • 85
2
votes
2 answers

ActionBarSherlock › How to implement TabNavigation on SherlockActionbar + RoboGuice?

I'm using RoboGuice+SherlockActionBar-V4.0 and building a sample app to test tab-navigation , I checked the roboguice-sherlock example which is coming with SherlockActionBar package but ... no help . How can I switch the activities with the Tabs…
HibernatedGuy
  • 1,939
  • 2
  • 12
  • 15
2
votes
1 answer

Inject Android Activity into a POJO with Roboguice

Is there a way to inject an Android Activity subclass into a POJO using Roboguice?
Julian A.
  • 10,928
  • 16
  • 67
  • 107
2
votes
1 answer

Maven, ActionBarSherlock v4 and Roboguice v2 - How do I get it to build?

I'm trying to build a project to uses both ActionBarSherlock v4 and Roboguice v2 (I like beeing of the bleeding edge :) ). The problem is that ABS uses a slightly modified compatibility library, that Roboguice needs. I got it working fine under…
Thierry Roy
  • 8,452
  • 10
  • 60
  • 84
2
votes
1 answer

Cannot get Roboguice Astroboy example to work

I've spent hours trying to get Roboguice to work, but with no success. My latest effort involved trying to get the Astroboy example to work but I've run into problems after (eventually) getting it to deploy. This is a summary of my steps…
DJ180
  • 18,724
  • 21
  • 66
  • 117
2
votes
1 answer

Android - UITesting with Robotium?

I am trying to use robotium to test my Activities. I used guice and roboguice for Dependency injection all over my code. Is there anything I have to do to allow Injection while running my automation tests? or is robotium going to do that for…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
2
votes
1 answer

Roboguice in ItemizedOverlay

I am exploring the world of RoboGuice and have changed an maps activity to now work with it. It is a RoboMapActivity and I have changed my extension of Application to inherit from RoboActivity. I have used @InjectView successfully as below.. public…
Uniqe
  • 257
  • 4
  • 8
2
votes
1 answer

Expresso tests throwing java.lang.NoClassDefFoundError: roboguice.inject.AssetManagerProvider on API level 20 and below devices

My tests work perfectly on devices with API level 20 and above but fail for API level 19 and below. Issue seems to be with roboguice but I am unable to find a solution for it. Please help. The logs are as below. 03-15 05:06:54.600 1748-1748/?…
2
votes
0 answers

Inject POJO in ActivityInstrumentationTestCase2 using RoboGuice

I have a problem with a RoboGuice injection in POJO in tests. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" Test.class public abstract class Test extends…
Gorets
  • 2,434
  • 5
  • 27
  • 45