Kay-Uwe Janssen edited this page Oct 9, 2016 · 13 revisions

Since AndroidAnnotations 1.0

AndroidAnnotations fully integrates with RoboGuice 1.1.1.

Since AndroidAnnotations 3.1

Since this release RoboGuice 1 support has been dropped in favor of RoboGuice 2.

Since AndroidAnnotations 3.3

Since this release RoboGuice 3 and newer is only supported.

Since AndroidAnnotations 4.0.0

The RoboGuice integration is now split into an AA plugin. To use this functionality, you must add the roboguice plugin to your project.

Android Annotations Logo Roboguice Logo

Integrating RoboGuice and AndroidAnnotations

  1. Add AndroidAnnotations to your project.
  2. Add RoboGuice to your project.
  3. Instead of having activities that inherit from RoboActivity, simply annotate them with @RoboGuice.
  4. Looking for a working example ? Have a look RoboGuiceExample!
@RoboGuice({AstroListener.class, AnotherListener.class})
public class AstroGirl extends Activity {
	EditText edit;
	GreetingService greetingService;
	void button() {
		String name = edit.getText().toString();
public class AstroListener {

        Context context;

        public void doSomethingOnResume(@Observes OnResumeEvent onResume) {
                Toast.makeText(context, "Activity has been resumed", Toast.LENGTH_LONG).show();

What are the advantages of using RoboGuice?

RoboGuice brings the power of the Guice framework to your Android application. It means that you can benefit from dependency injection advantages : low coupling, higher maintainability.

What are the advantages of using AndroidAnnotations?

  • Compile time injection of Android components (=> no perf impact)
  • Extending RoboActivity is not needed any more. This basically mean that you can inherit from any activity class, even those not supported by RoboGuice. Think about it if you want to use other frameworks that require you to extends their own base activity class.
  • Support for @Click, @Background, @UiThread, @ItemSelect, etc.

21/10/2018 The 4.5.2 release is out !

Using AndroidAnnotations


Enjoying AndroidAnnotations

Improving AndroidAnnotations

Extending AndroidAnnotations

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.