Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>After 4 months I am 4 months older and a little smarter :) If you want to use Annotations in Android use http://jakewharton.github.io/butterknife/. It is way better and it is easy to set up :) </code></pre> <p>Here is what you need to do:</p> <ul> <li>You need to modify your build.gradle file (build file for your application module)</li> </ul> <p>First add dagger and annotations version. You can also declare them in dependencies. This is just more convenientwhen you have a lot of dependencies.</p> <pre><code>ext.daggerVersion = '1.0.0'; ext.androidAnnotationsVersion = '2.7.1'; configurations { apt } </code></pre> <p>Add dependencies:</p> <pre><code>dependencies { apt "com.googlecode.androidannotations:androidannotations:${androidAnnotationsVersion}" compile "com.googlecode.androidannotations:androidannotations-api:${androidAnnotationsVersion}" apt "com.squareup.dagger:dagger-compiler:${daggerVersion}" compile "com.squareup.dagger:dagger:${daggerVersion}" } </code></pre> <p>Finnaly, add this. This adds path for compiler and creates a dir for generated files (this dir will be called apt_generated):</p> <pre><code>android.applicationVariants.each { variant -&gt; aptOutput = file("${project.buildDir}/source/apt_generated/${variant.dirName}") println "****************************" println "variant: ${variant.name}" println "manifest: ${variant.processResources.manifestFile}" println "aptOutput: ${aptOutput}" println "****************************" variant.javaCompile.doFirst { println "*** compile doFirst ${variant.name}" aptOutput.mkdirs() variant.javaCompile.options.compilerArgs += [ '-processorpath', configurations.apt.getAsPath(), '-AandroidManifestFile=' + variant.processResources.manifestFile, '-s', aptOutput ] } } </code></pre> <p>Oh, yes, and after you build your aplication, you need to go to project root/build/apt_generated, right click on folder and set "Mark as source root"</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload