-
Notifications
You must be signed in to change notification settings - Fork 0
Home
We want to facilitate the writing and the maintenance of Android applications.
We believe that simple code with clear intents is the best way to achieve those goals. As Robert C. Martin said:
The ratio of time spent reading [code] versus writing is well over 10 to 1 [therefore] making it easy to read makes it easier to write.
simplify the Android development model, and
Our goal is to simplify the Android development model, and get rid of the unneeded complexity
Using Java annotations, developers can show their intent
- Simplified threading model: annotate your methods to ensure they'll be executed on the UI thread or on a background thread.
- Event binding: annotate methods to handle events on views, no more ugly anonymous listener classes!
- Dependency injection: inject views, extras, system services, resources, and even custom objects and let AndroidAnnotations take care of the details.
- Rest client: define a client interface with a few annotations, and AndroidAnnotations takes care of the implementation details.
- AndroidAnnotations provide those good things and even more for less than 50kb, without any runtime perf impact!
- Convinced? Get started!
- Curious? Read how it works
- Need proofs? See the apps already using AndroidAnnotations
- Looking for recipes? Read the cookbook
Is your Android code easy to write, read, and maintain?
Here is how clear it will be with AndroidAnnotations:
@EActivity(R.layout.translate) // Sets content view to R.layout.translate
public class TranslateActivity extends Activity {
@ViewById // Injects R.id.textInput
EditText textInput;
@ViewById(R.id.myTextView) // Injects R.id.myTextView
TextView result;
@AnimationRes // Injects android.R.anim.fade_in
Animation fadeIn;
@Click // When R.id.doTranslate button is clicked
void doTranslate() {
translateInBackground(textInput.getText().toString());
}
@Background // Executed in a background thread
void translateInBackground(String textToTranslate) {
String translatedText = callGoogleTranslate(textToTranslate);
showResult(translatedText);
}
@UiThread // Executed in the ui thread
void showResult(String translatedText) {
result.setText(translatedText);
result.startAnimation(fadeIn);
}
// [...]
}The project logo is based on the Android logo, created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
14/06/2012 The 2.6 release is out
- Get started!
- Cookbook, full of recipes
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow