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

Injecting dependency with Guice in non-constructor method

I'm working on a component that creates HTTP requests dynamically, and I'd like to be able to mock those requests for unit testing. Currently the implementation looks something like this: class ModelClass { public void populate() { …
sak
  • 2,612
  • 24
  • 55
2
votes
0 answers

How do I use RoboUnitTestCase?

I'm trying to follow the (official, I think) guide to RoboGuice on https://github.com/roboguice/roboguice/wiki/Testing, but I can't figure out the first example. It seems to use a class called roboguice.test.RoboUnitTestCase so it can call…
Cliabhach
  • 1,402
  • 2
  • 12
  • 19
2
votes
0 answers

Android ProGuard with RoboGuice

I am using RoboGuice in my android project. I added the proguard rules as specified in the documentation: https://github.com/roboguice/roboguice/wiki/ProGuard However, after I run the release apk, I get java.lang.NullPointerException crashes on…
dors
  • 5,802
  • 8
  • 45
  • 71
2
votes
1 answer

Robguice proguard forces

This is the bare minimum specified by Roboguice for proguard support: https://gist.github.com/matthawley/1327908 I am forced to add these to prevent the code from crashing: -keep class com.appmanager.ui.fragments.* { *; } -keep class…
JY2k
  • 2,879
  • 1
  • 31
  • 60
2
votes
0 answers

Inject Extra into DualPane (FragmentExample) DetailFragment

Hello fellow Overflows, I am new to RoboGuice and I pretty like it. I am building an App based on the Master/Detail-Flow-Template. When I click on a list-element I pass it to the Detail-Fragment using Extras. As RoboGuice offers it, I am using the…
Langusten Gustel
  • 10,917
  • 9
  • 46
  • 59
2
votes
2 answers

Change injection modules for Espresso

I have an app that make some calls to a REST API. I am using Retrofit to implement the API and I am using Roboguice to inject my REST service where needed. I am trying to write up a test suite using espresso. I want to use a custom injection module…
Tiago Veloso
  • 8,513
  • 17
  • 64
  • 85
2
votes
1 answer

Global Event Manager Roboguice

I am using RoboGuice 3.0.1 along with RoboBlender in my Android application. I wanted to have a global event manager and noticed that RG3.0 already has it as mentioned here: https://github.com/roboguice/roboguice/issues/150 I have added…
Vijay
  • 435
  • 1
  • 6
  • 16
2
votes
0 answers

DI framework for Android

I am looking for open source Dependency Injection framework for android , After doing some search found that there are multiple frameworks available e.g RoboSpring,RoboGuice,TinnySpring. Can someone please suggest which option is better one in…
2
votes
1 answer

Lazy injection with Roboguice

In all Android projects I posted on Google Play I've always used for dependency injection Roboguice. Recently I was able to see the benefits of Roboguice 3.0 and then I decided to investigate other libraries on Android for dependency injection not…
Jose Rodriguez
  • 9,753
  • 13
  • 36
  • 52
2
votes
1 answer

How to make Roboguice 3.0 jar from sources

I need to migrate from roboguice 2.0 to 3.0 in order to use the fragments from API 14 instead of the ones from support v4 library. I've seen that on github there is a release for 3.0 https://github.com/roboguice/roboguice/releases/tag/roboguice-3.0,…
mawus
  • 1,178
  • 1
  • 11
  • 25
2
votes
1 answer

Injected views are null with RG 3.0

I am using RoboGuice 3.0 in Android Studio directly since I need support for ActionBarActivity. This is my dep: compile 'org.roboguice:roboguice:3.0' First odd thing I had to do was to resolve a ClassNotFoundException for "Unable to use annotation…
2
votes
1 answer

RoboGuice: how to use RoboGuice-provided injections in my custom class?

I've created a class that depends on a ContentResolver: public class MyClass { // these Injects won't work @Inject private ContentResolver m_contentResolver; @Inject public MyClass( ContentResolver resolver ) { …
2
votes
1 answer

RoboActionBarActivity for RoboGuice

I use Gradle to add the dependency org.roboguice:roboguice:3.0b-experimental to my project. I found a post on the issue tracker, saying that there should be a RoboActionBarActivity class (to replace the ActionBarActivity I use for drawer navigation)…
phm
  • 108
  • 5
2
votes
1 answer

Injecting 3rd Party libraries w/ Guice @Provides

I'm trying to create a Guice 2 Module to wrap a third party API using @Provides methods. The problem is I'm not exactly sure how to properly bind to the @Provides methods. The 3rd library doesn't expose interfaces for its singletons, so I'm just…
HolySamosa
  • 9,011
  • 14
  • 69
  • 102
2
votes
1 answer

RoboGuice provision errors

I am using RoboGuice Providers to injecting custom dependencies. I have two providers the first provides a Facebook AccessToken and second provides a Facebook instance which requires a access token therefore I inject it using the first provider. …
user2054833
  • 2,115
  • 7
  • 24
  • 39