Androidstudio adding androidannotations

Source: Internet
Author: User

1. Add dependency to Apt

Buildscript {    repositories {        mavencentral ()    }    dependencies {        classpath ' com.neenbedankt.gradle.plugins:android-apt:1.2+ '    }}

2. Apply Apt Plugin

Apply plugin: ' Android-apt '

3. Configure apt parameters, replace Com.example.package.name with project name

Apt {    arguments {        androidmanifestfile variant.processResources.manifestFile        resourcepackagename " Com.example.package.name "    }}

4. Add dependency on Androidannotation

dependencies {    apt "org.androidannotations:androidannotations:3.0+"          //Add these    compile " org.androidannotations:androidannotations-api:3.0+ "  //lines    compile ' com.android.support: appcompat-v7:+ '    compile Filetree (dir: ' Libs ', include: [' *.jar '])}

5. Full version

buildscript {repositories {mavencentral ()} dependencies { Classpath ' com.neenbedankt.gradle.plugins:android-apt:1.2+ '}}apply plugin: ' Android ' Apply plugin: ' Android-apt ' an Droid {compilesdkversion buildtoolsversion "19.0.1" Defaultconfig {minsdkversion 8 targetsdkve            Rsion Versioncode 1 Versionname "1.0"} buildtypes {release {Runproguard false Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' proguard-rules.txt '}}}apt {Argum Ents {androidmanifestfile variant.processResources.manifestFile resourcepackagename "com.example.package.na Me "}}dependencies {apt" org.androidannotations:androidannotations:3.0+ "compile" org.androidannotations:android annotations-api:3.0+ "Compile ' com.android.support:appcompat-v7:+ ' compile Filetree (dir: ' Libs ', include: [' *.jar ']) }

From http://www.jayway.com/2014/02/21/androidannotations-setup-in-android-studio/

Androidstudio adding androidannotations

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.