Android Annotations Open Source Framework learning + eclipse (i)

Source: Internet
Author: User

1. Download the relevant Jar package (: HTTPS://REPO1.MAVEN.ORG/MAVEN2/ORG/ANDROIDANNOTATIONS/ANDROIDANNOTATIONS-BUNDLE/3.3.1/ Androidannotations-bundle-3.3.1.zip)

2. Configure Eclipse to import Androidannotations-api-3.3.1.jar under Libs and add the Compile-lib folder to the Eclipse project, where you put: Androidannotations-3.3.1.jar

Still need to set the annotation compilation Jar in the project (now the eclipse bundle hits Java Compiler cannot find Annotation Processin is due to the lack of plug-ins, the plugin address and installation name are as follows:

Juno-http://download.eclipse.org/release/juno Eclipse Java Development Tools in a set of plugins

3. Preliminary Android Annotations

@EActivity Label use:

1 Import org.androidannotations.annotations.EActivity;

2Importandroid.app.Activity;
3ImportAndroid.os.Bundle;
4@EActivity (R.layout.activity_main)
5 PublicclassMainactivityextendsActivity {
6
7@Override
8protectedvoidOnCreate (Bundle savedinstancestate) {
9 Super. OnCreate (Savedinstancestate);
Ten//Setcontentview (r.layout.activity_main);
One}

A  }

To ensure that the program is running, you need to change mainactivity to: Mainactivity_ in Manifest***.xml

Run successfully.

Android Annotations Open Source Framework learning + eclipse (i)

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.