Android developed Android annotations framework

Source: Internet
Author: User

Yesterday we studied the use of Volley network communication framework, and today we have studied the Android annotations framework, and found that Android annotations framework really can reduce the amount of code.


Android Annotations is an open-source framework for accelerating the development of Android applications, allowing you to focus on the implementation of functionality, simplifying code, and improving maintainability.


Function module:


1. Using Dependency Injection (Dependency injection)
---------------------------------------------------------------------------------------
2. Simplified threading models (simplified threading model)
---------------------------------------------------------------------------------------
3. Event Binding
---------------------------------------------------------------------------------------
4. REST Client
---------------------------------------------------------------------------------------
5. No Magic


Pros: Full annotations make it easier to develop and programmers write less code.


The following is a simple example.

@NoTitle//Cancel title @fullscreen//full Screen @eactivity (R.layout.activity_main)// Layout file to change mainactivity in Androidmanifest.xml to Mainactivity_public class Mainactivity extends Activity {// Call string resource @stringresstring Hello_world; @StringRes (r.string.action_settings) string setting;// Findviewbyid variable name to match the control name @viewbyidtextview textView1; @AfterViewsvoid init () {Textview1.settext ("");} Click on the event method name to match the control name @clickvoid button1clicked () {Textview1.settext ("click" + Hello_world);} @LongClickvoid button1longclicked () {Textview1.settext ("long click" + setting);}}


In the example, I give a detailed comment. This is a few simple applications are also the most used. Please refer to the official documentation for more information on how to use.

Github: Click to open link

There are detailed usage methods and configuration methods on GitHub, including Eclipse and Android studio and methods.


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android-developed Android annotations framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.