Androidannotations (Code Diet)
Introduction to the Android Rapid development framework:
Project Address: Https://github.com/excilys/androidannotations
Document Description: Https://github.com/excilys/androidannotations/wiki
Website: http://androidannotations.org/
Features: (1) Dependency injection: including View,extras, system services, resources, etc.
(2) A simple threading model that runs on a UI thread or a background thread through the annotation representation method
(3) Event binding: Represents the response event of a view through annotation, without writing an internal class
(4) Rest client: Define the Client interface and automatically generate the implementation of the rest request
(5) Not as complex as you might think: androidannotations just generates the appropriate subclass at compile time
(6) Does not affect the application performance: only 50KB, completed at compile time, does not have the effect on the runtime.
PS: Compared to Roboguice: Roboguice is reflected through runtime read annotations, so it may affect application performance and androidannotations generate subclasses at compile time, so there is no performance impact
The author is in the configuration development under the Android studio, in the process of configuration, in addition to a little problem, the solution is recorded in this:
Issue 1:error: (2, 0) Plugin with the id ' android-apt ' not found.
This issue appears in the module configuration Build.gradle as follows:
dependencies { def aaversion = ' 3.2 ' apt ' org.androidannotations:androidannotations: $AAVersion " compile "Org.androidannotations:androidannotations-api: $AAVersion"}
Workaround:In Project Build.gradle, add the following configuration:
Buildscript { repositories { jcenter () } dependencies { classpath ' com.android.tools.build: gradle:1.2.3 ' classpath ' com.neenbedankt.gradle.plugins:android-apt:1.4 '//added line }}
Issue 2:error: (33, 1) Error: The Androidmanifest.xml file contains the original component, and not the androidannotations Generat Ed component. Please register mainactivity_ instead of mainactivity
The error locating code appears as follows:
@EActivity (r.layout.activity_main) public class Mainactivity extends appcompatactivity{ //... @Override protected void onCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); Initviews (); }
Follow the prompts to fix the error as follows:
Well, before you run, click Compile.
Ok,run.
Reference:
Https://github.com/Trinea/android-open-project
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Use of the Androidannotations library