Androidannotations Framework Configuration

Source: Internet
Author: User

Now Android studio popularity, Android development basically to abandon eclipse, recently using the Androidannotations annotation framework, the time to find some information slowly complete, here to you to share briefly:

First of all, gradle inside configuration can be provided according to the framework of the official website study, gradle configuration website address: https://github.com/excilys/androidannotations/wiki/ Building-project-gradle is here to make a brief description of it:

Three points: First add the following information to the global gradle file

Buildscript {
repositories {
Jcenter ()
Mavencentral ()//Add MAVEN Center Warehouse
}
dependencies {
Classpath ' com.android.tools.build:gradle:1.3.0 '
Classpath ' com.neenbedankt.gradle.plugins:android-apt:1.4 '//Add load Address

}
}

repositories {
Mavencentral ()//Add MAVEN Center Warehouse
Mavenlocal ()//Add local maven Repository
}

allprojects {
repositories {
Jcenter ()
}
}

Task Clean (type:delete) {
Delete Rootproject.builddir
}

Then the second step is to add the following information to the Gradle of the project app:

Apply plugin: ' Com.android.application '
Apply plugin: ' android-apt '//need to add

def aaversion = ' 3.3.2 '//need to be added to customize the version number according to the current version
Android {
Compilesdkversion 23
Buildtoolsversion "22.0.1"

Defaultconfig {

Minsdkversion 14
Targetsdkversion 23
Versioncode 1
Versionname "1.0"
}
Buildtypes {
Release {
Minifyenabled false
Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro '
}
}
}

dependencies {
Compile Filetree (include: [' *.jar '], dir: ' Libs ')
Testcompile ' junit:junit:4.12 '
Compile ' com.android.support:appcompat-v7:23.0.1 '
Compile ' com.android.support:design:23.0.1 '
Apt "org.androidannotations:androidannotations: $AAVersion"//needs to be added
Compile "ORG.ANDROIDANNOTATIONS:ANDROIDANNOTATIONS-API: $AAVersion"//needs to be added
}

Apt {//entire content needs to be added
arguments {
Androidmanifestfile Variant.outputs[0].processresources.manifestfile
}
}

When the final construction, if the speed is slow, you need to bring your own FQ, then in the configuration manifest file to change the name of the activity, at the end of the add an underscore _, if the error is compiled on the words can be!!!

The final configuration is so complete, the framework is really very convenient to use Yo ~ ~ ~ ~ ~ ~

Androidannotations Framework Configuration

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.