Android - Roboguice 2.0 setup?

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 appropriate package for this class. I looked at the source, and the roboguice package is roboguice.application.RoboApplication , which does not exist. There is no roboguice application in my project.

What am I missing?

+7
source share
2 answers

So, disappointingly, the development of the roboguice library exceeded its documentation . There is no RoboApplication class in the new library.

Instead, you should delete this file and create a roboguice.xml file in your values ​​that points to your custom robo module:

 <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="roboguice_modules"> <item>com.mypackage.MyModule</item> </string-array> </resources> 

Also, if you used AbstractAndroidModule or RoboModule for your module code, now it is called AbstractModule.

+25
source

If you use RoboGuice 2, you should use Guice 3, not Guice 2 !!! The wiki has quite a bit of documentation. In particular, check

http://code.google.com/p/roboguice/wiki/InstallationNonMaven

http://code.google.com/p/roboguice/wiki/UpgradingTo20

+2
source

All Articles