### Configure IntentBuilder Installation with Gradle Source: https://github.com/emilsjolander/intentbuilder/blob/master/README.md This snippet demonstrates how to configure the IntentBuilder library in an Android Gradle project. It includes adding the 'android-apt' plugin to the buildscript and declaring the 'intentbuilder-api' and 'intentbuilder-compiler' dependencies for annotation processing. ```groovy buildscript { repositories { jcenter() } dependencies { classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' } } apply plugin: 'com.neenbedankt.android-apt' dependencies { compile 'se.emilsjolander:intentbuilder-api:0.14.0' apt 'se.emilsjolander:intentbuilder-compiler:0.14.0' } ``` -------------------------------- ### Implement IntentBuilder in an Android Activity Source: https://github.com/emilsjolander/intentbuilder/blob/master/README.md This Java code shows how to use IntentBuilder with an Android Activity. It demonstrates annotating the activity with @IntentBuilder, marking fields with @Extra (and @Nullable for optional ones), injecting extras using the generated IntentBuilder class's static inject() method, and building an Intent to start the activity. ```java @IntentBuilder class DetailActivity extends Activity { @Extra String id; @Extra @Nullable String title; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DetailActivityIntentBuilder.inject(getIntent(), this); // TODO use id and title } startActivity(new DetailActivityIntentBuilder("12345") .title("MyTitle") .build(context)) } ``` -------------------------------- ### Implement IntentBuilder in an Android Service Source: https://github.com/emilsjolander/intentbuilder/blob/master/README.md This Java code illustrates how to integrate IntentBuilder with an Android IntentService. It involves annotating the service with @IntentBuilder, defining an @Extra field for intent parameters, injecting extras in onHandleIntent using the generated IntentBuilder class's static inject() method, and building an Intent to start the service. ```java @IntentBuilder class DownloadService extends IntentService { @Extra String downloadUrl; @Override protected void onHandleIntent(Intent intent) { MyServiceIntentBuilder.inject(intent, this); } } startService(new DownloadServiceIntentBuilder("http://google.com").build(context)) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.