Used to use ECLICPS used to now want to learn to use Android Studio two days of study finally on my computer installed an Android studio and completed the Androidannotations configuration.
Androidannotations is an open source framework that allows you to develop your Android quickly, allowing you to focus on what really matters. Making the code more streamlined makes the project easier to maintain, and its goal is "Fast Android development.easy maintainance". Plainly, you can write a lot less code, haha.
Androidannotations is an open source project project address interested friends can go and study. All right, that's not much nonsense.
1 We need to download the androidannotations.
2 new Folder Compile-libs
3 copy Androidannotations-3.2.jar to compile-libs Androidannotations-api-3.2.jar copy to Libs
Such as:
4 Add classpath ' com.neenbedankt.gradle.plugins:android-apt:1.4 ' to the build.gradle of the project
Such as:
5 added in the model's Build.gradle
5.1 Apply plugin: ' Android-apt '
def aaversion = ' 3.2+ '
5.2 Apt "org.androidannotations:androidannotations: $AAVersion"
Compile "Org.androidannotations:androidannotations-api: $AAVersion"
Compile ' com.android.support:support-v4:22.1.1 '
5.3 Apt {
arguments {
Androidmanifestfile Variant.outputs[0].processresources.manifestfile
Resourcepackagename ' Org.shuaibi.hi_blog '
}
}
Such as:
The configuration is done here, let's see how to use it.
Package Org.shuaibi.hi_blog.activity;import Android.app.activity;import android.content.intent;import Android.os.bundle;import Android.widget.textview;import Android.widget.toast;import Org.androidannotations.annotations.afterviews;import Org.androidannotations.annotations.click;import Org.androidannotations.annotations.eactivity;import Org.androidannotations.annotations.viewbyid;import Org.shuaibi.hi_blog. R; @EActivity (R.layout.activity_main)//Specify a ViewPublic class Mainactivity extends Activity {@ViewById (R.id.main_tv_hello) TextView Mhelloword;//Bound Control@Override protectedvoidonCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); } @Click (R.id.main_tv_hello)//Click events to pressPublicvoidHello_click () {Intent Intent=NewIntent ( This, Blogdetailactivity_.class); StartActivity (Intent); } @AfterViews//execution After the view has been loadedPublicvoidinit () {Toast.maketext ( This, "View loading Complete", Toast.length_short). Show (); }}
Finally, add _ to the activity in the Androidmanifest file (this is a lower horizontal bar)
If you want to configure in Eclipse please go here--send
Not very familiar with Android Studio what's wrong, please advise
Android Studio Configuration Androidannotations--hi_ Blog Android APP Development notes