
You can find most of these libraries on the downloads page of the RoboGuice website ( is in the guice-3.0 archives) and you can find the jsr305 jar on the Guice website. To use RoboGuice you will need RoboGuice, Guice, javax.inject and the jsr305 library.
#ROBOLECTRIC LOG ANDROID STUDIO ANDROID#
The first thing to do is create the main Android project and add the dependencies. You can download the sample project and test project from here (the android.jar is omitted and should be linked in the test project). Check out the screenshot below to see the UI in action. To get started with RoboGuice we’ll create a simple project that is able to convert distances from feet to meters. This blog post will walk you through a minimal project that uses RoboGuice accompanied by a test project that uses Robolectric and Mockito for test execution. In theory it should be super simple to create tests for a Guice-based application but in practice several challenges have to be overcome when injecting test relevant classes. Having such a loosely coupled project poses a new set of problems for testing the system. OSGi injects components on a much more abstract service level whereas Guice encourages injecting every class from a widget to a util class.
#ROBOLECTRIC LOG ANDROID STUDIO CODE#
Coming from an OSGi background, it is interesting to see how much deeper Guice is able to be interwoven into the Java code when your entire project is composed of injected classes. RoboGuice is an extension for the Google Guice dependency injection framework that adds several Android specific mechanisms to easily inject views, services or custom objects.

I’ve been using the Android framework RoboGuice 2.0 a lot lately.
