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
0 answers

RoboService exception on screen orientation change

Hy, I have an activity that is binding/unbinding to a service in OnStart()/OnStop(). If I open a link from a list ( that opens in a browser) while holding the phone horizontally the application crashes. I would like to mention that the activity is…
tetius
  • 455
  • 1
  • 4
  • 7
2
votes
1 answer

Robolectric and SQLite.getVersion

In my case getVersion in Robolectric SQLiteOpenHelper returns always 0. Because of this onCreate is called in DBHelper if the current DATABASE_VERSION is for example greater than 0. Does anyone know how to configure/set the Database-Version in…
Mike Mitterer
  • 6,810
  • 4
  • 41
  • 62
2
votes
2 answers

Simple android application with roboguice throwing exceptions

I have a very simple application that works but when i add roboguice it throws java.lang.RuntimeException: Unable to instantiate application com.MyFirstApp.MyFirstApplication: java.lang.ClassNotFoundException: …
Duncan Roosma
  • 481
  • 7
  • 21
1
vote
2 answers

In Roboguice, where can I find @ContentView?

I'm trying out Robguice's Astroboy example and one of the first lines of code in the startin activity is @ContentView annotation which is supposed to be found in the "roboguice.inject.*" package. On the Javadoc on the project home, it's not found.…
Mark Lapasa
  • 1,644
  • 4
  • 19
  • 37
1
vote
3 answers

How I get the Context with guice in provider?

How I get the Context? Am I doing something wrong here? This is my Error in Android: FATAL EXCEPTION: main com.google.inject.CreationException: Guice creation errors: 1) Error injecting constructor, java.lang.NullPointerException…
user949884
  • 503
  • 1
  • 8
  • 15
1
vote
1 answer

RoboFragments in layout.xml

I've been trying to get Roboguice to work with fragments declared in a block in the layout file and then injected into the activity, but, although the fragment exists somewhere off screen (an EditText in the fragment takes focus and fires…
JRaymond
  • 11,625
  • 5
  • 37
  • 40
1
vote
2 answers

dx fails with RoboGuice

I'm trying to package an Android app which uses RoboGuice. The .class files compile fine, but when building the Android package, dx fails with a "No expanded opcode" message. Running dx --dex --debug --verbose target/android-classes…
1
vote
3 answers

Roboguice injecting system service

I am learning to use Roboguice and I'm having som trouble understanding how to inject a system service. All the examples I've seen is injecting into an activity but I want to inject it into a POJO. I'm using Roboguice 2.0 beta 3 I have a PhoneNumber…
Kjetil Eide
  • 1,404
  • 1
  • 15
  • 20
1
vote
1 answer

Inversion Of Control New Object Creation

I am getting into Inversion of Control, specifically using Guice and RoboGuice for Android and I have a question. I have a method call that returns a Resource (which is essentially an XML or JSON String). public Resource getResource(){ // Some…
skaz
  • 21,962
  • 20
  • 69
  • 98
1
vote
1 answer

Scala+Android+Roboguice: ClassNotFoundException in loader

I'm evaluating Scala on Android by starting with the NotesList demo. I was able to replace the NotesLiveFolder.java file with its Scala equivalent without problem. Next, I introduced Roboguice, creating a simple NotesListApplication.java that sets…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
1
vote
2 answers

Nothing happens when I configure RoboGuice

I am new to RoboGuice and I am trying to set up my activity to use DI. However, nothing happens when I attempt to use it. I only get a blank black window with no content and no logging in my Activity.onCreate() method after I call…
DJ180
  • 18,724
  • 21
  • 66
  • 117
1
vote
1 answer

Mock framework works with dependency injection framework in unit test

When I writing tests with EasyMock and Guice framework, I encounter a problem. The code is like: class A { B b; @Inject public A(B b) { this.b = b; this.b.addListener(this); } } class ATest { @Inject A a; …
papalagi
  • 710
  • 2
  • 8
  • 20
1
vote
1 answer

How are Android-Binding and Roboguice?

As a beginner for Android development, code samples I am learning from look somewhat disorganized and are hard to test or even to understand. So I followed this post suggested: Using Dependency Injection with Roboguice? and am trying to use…
Jon
  • 332
  • 4
  • 14
1
vote
2 answers

Roboguice /getInstance + best practice

I just started using Roboguice (+Guice) and I am not sure about the best practice how to use it. In my Activity I have about 5 functions (out of about 30) which uses an object called "ProviderQueries" (Singleton). I could use it in two ways: 1.) …
Mike Mitterer
  • 6,810
  • 4
  • 41
  • 62
1
vote
1 answer

RoboGuice getInjector alternate in HILT (Dagger2)

I am in process of migrating to HILT from RoboGuice in my current app, there are alot of placs where injection in RoboGuice is done using below way: IHelper helper = RoboGuice.getInjector(getApplicationContext()).getInstance(IHelper.class); Dose…
Adil Bhatty
  • 17,190
  • 34
  • 81
  • 118