[androidannotations frame] Configuration of the Androidannotations

Source: Internet
Author: User
<span id="Label3"></p>first, under the Androidstudio configuration androidannotations <ol> <ol> <li><p>First of all, prepare your Project.</p></li> <li><p>Androidstudio under the Androidannotations configuration is relatively easy, only need to configure two build.gradle to be able.</p></li> <li><p>Configuration <code>build.gradle</code><br>(1) We first configure the <code>build.gradle</code> Preject directory<br>Add under Buildscript> dependencies></p></li> </ol> </ol><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs bash">classpath<span class="hljs-string">‘com.neenbedankt.gradle.plugins : android-apt : 1.4‘</span></code></pre></pre><p><p>(2) then configure the <code>build.gradle</code> app directory<br>1) <code>apply plugin:‘com.android.application‘</code> Add a line below</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs bash"><span class="hljs-string">‘com.android.application‘</span><span class="hljs-string">‘com.neenbedankt.android-apt‘</span></code></pre></pre><p><p>2) define a version of the constant, the current latest version is 3.3.2</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> </span><span class="hljs-constant">AAVersion</span><span class="hljs-string">‘3.3.2‘</span></code></pre></pre><p><p>3) Add Dependency</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs bash"><span class="hljs-string">"org.androidannotations : androidannotations : <span class="hljs-variable">$AAVersion</span>"</span><span class="hljs-string">"org.androidannotations : androidannotations-api : <span class="hljs-variable">$AAVersion</span>"</span> }</code></pre></pre><p><p>4) Add apt</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs avrasm">apt { arguments { androidManifestFile variant<span class="hljs-preprocessor">.outputs</span>[<span class="hljs-number">0</span>]<span class="hljs-preprocessor">.processResources</span><span class="hljs-preprocessor">.manifestFile</span> } }</code></pre></pre> <ol> <ol> <li>Then build up project and it's OK ~</li> </ol> </ol>Ii. Configuring Androidannotations under Eclipse <ol> <ol> <li>Download the required Jar Package. , the current latest version is 3.3.2. Unzip the tarball and get the <code>androidannotations-api-*.jar</code> and <code>androidannotations-*.jar</code> .</li> <li>Import the jar package into the Project. <code>androidannotations-api-*.jar</code>put it in the project directory <code>libs</code> , create a new directory under the project directory, and place it in the <code>compile-libs</code> <code>androidannotations-*.jar</code> <code>compile-libs</code> directory.</li> <li>Configuration Engineering.<br><strong>Step one:</strong> Properties>java compiler> tick at Enable project specific settiongs, then set Compiler compliance level:1.6<br><br><strong>Step two:</strong> Properties>java compiler>annotation processing> Tick at enable project specific settiongs<br><br><strong>Step three:</strong> Properties>java compiler>annotation processing>factory path> tick at Enable project specific settiongs, then add Jars-> Browse the project directory, select <code>compile-libs</code> the directory <code>androidannotations-*.jar</code> , and finally Ok.<br><br></li> <li>Then you can start using the frame ~</li> </ol> </ol> <p><p> [configuration of Androidannotations framework]androidannotations </p> </p></span>

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.