Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
5
Help us understand the problem. What is going on with this article?
@tomoktan_cansell

【今更感】AndroidAnnotations導入

More than 5 years have passed since last update.

公式サイト

導入手順

自分はGradleで導入したので、ここではGradleでの導入方法を書きます。

公式のGet Startedはこちら
https://github.com/excilys/androidannotations/wiki/Configuration

build.gradle(Project)に色々追加

  • buildScriptのrepositoriesの向き先をjcenter()からmavenCentral()に変更
  • dependenciesに「android-aptを追加」
buildscript {
    repositories {
        mavenCentral() // 追加
        // jcenter() ※コメントアウト
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // 追加
    }
}

build.gradle(Module)に色々追加

  • android-aptをapply
  • dependenciesに「androidannotations」と「androidannotations-api」を追加
apply plugin: 'com.android.application'
apply plugin: 'android-apt' // 追加
def AAVersion = '4.0.0' // 追加

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "~~~"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

これでGradleをSyncしたらandroidannotationsを利用できるようになっていると思います。
試しにActivityをEActivityで書いてみましょう。

...続きは後で書きます。

5
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
5
Help us understand the problem. What is going on with this article?