android-annotations

AndroidAnnotations and Unit Testing

扶醉桌前 提交于 2019-12-06 08:17:55
问题 I am using AndroidAnnotations(2.5) in a sample project I am currently working on. Since you can annotate your classes with for example @EActivity , @ViewById , @Click which will all lead to generated compile-time code, I was wondering how one would go about creating unit tests / functional tests for any Android Annotations powered application. I would love to hear some opinions on this matter. Cheers, 回答1: I responded to a similar post here. There are a couple of options available to you. You

annotationprocessor and apt configure equivalent

与世无争的帅哥 提交于 2019-12-05 23:15:54
问题 I'm using AndroidAnnotaion , but due to Android Studio 2.3 and Gradle 2.3.0, they said android-apt was obsoleted. And annotationProcessor is a new one. so, I want to know how can I configure annotationProcessor like I do with apt before. If I misunderstand something, please help. So, before... apply plugin: 'android-apt' dependencies { def AAVersion = '4.2.0' apt "org.androidannotations:androidannotations:$AAVersion" compile "org.androidannotations:androidannotations-api:$AAVersion" } apt {

AndroidAnnotations Eclipse configuration with ADT 23

核能气质少年 提交于 2019-12-05 16:16:42
Since ADT 23, there seems to have no way to add Annotation Processor Factory Path to projects: No "Annotation Processing" item in Poject>Properties>Java Compiler. Does anyone know how to add androidannotations-X.X.X-api.jar to the annnotaions processing in the last Eclipse ADT? This is a known problem of the ADT bundle, and will be fixed as of ADT 23.0.3. In the meantime, you can fix this by downloading a standard Eclipse distribution and installing the ADT plugin to that. Or if you want to use your existing ADT bundle, you can install the necessary JDT plugin as described here . Also please

Maven + AndroidAnnotations generated but not reachable classes

自作多情 提交于 2019-12-05 15:42:10
Alright. I'm attempting to create a project which is perfectly build able by using maven, and maven only. Currently I'm facing this issue of classes being generated, and working fine, as long as there is no reference in actual java code. Meaning, that if I create an example as in the documentation it works. As soon as I do something like Intent i = new Intent(SettingsActivity_); then the build fails with Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project InterestingFind: Compilation failure cannot find symbol cannot find symbol symbol

androidannotations @AfterViews is not calling and editText is null

五迷三道 提交于 2019-12-05 10:52:06
I have a class and it extends from Fragment. Inside a class my editText is null and @AfterViews is not calling here is my code: @EFragment public class Search extends Fragment { private final String TAG = Search.class.getCanonicalName(); private static ProgressDialog progressDialog; private Activity activity; private ArrayList<String> urlList = new ArrayList<String>(); @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.search, container, false); Log.i(TAG, "onCreateView"); return rootView; }

Android Annotations could not find AndroidManifest.xml

淺唱寂寞╮ 提交于 2019-12-05 10:47:06
I've checked a few different questions, but none of them provided a solution which worked for me. I'm developing a project with Android Annotations, and when I attempt to build my project it fails with the following error (Project_Location is simply my local project folder): error: Could not find the AndroidManifest.xml file in specified path : [/Project_Location/mobile/build/intermediates/manifests/full/debug/AndroidManifest.xml] Here is my mobile build.gradle file: apply plugin: 'com.android.application' ext.androidAnnotationsVersion = '3.3.2'; ext.eventBusVersion = '2.4.0'; buildscript {

AndroidAnnotations how to add init code after onCreate

▼魔方 西西 提交于 2019-12-05 07:03:11
If I have an activity defined as: @EActivity(R.layout.activity_login) public class LoginActivity extends Activity This will create the onCreate() method for me, but I have extra init code that I want to go after the onCreate method, how should I do this? I could create my own onCreate method and use an empty @EActivity, but is there a better way? Mifeet Use the @AfterViews annotation to define your own initialization code: @AfterViews protected void init() { // your custom code } 来源: https://stackoverflow.com/questions/16718266/androidannotations-how-to-add-init-code-after-oncreate

Android annotations and applicationIdSuffix

时光总嘲笑我的痴心妄想 提交于 2019-12-05 03:14:34
I'd been trying out Android annotations recently and everything had been working well until I decided to add applicationIdSuffix in buildTypes in my build.gradle file. Currently it looks like this: buildTypes { debug { applicationIdSuffix '.debug' } ... } And upon compiling I get the following log in gradle console: :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:pre_testBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE :app:prepareDebugDependencies :app

AndroidAnnotations and Dagger

别来无恙 提交于 2019-12-05 02:44:34
I'm trying to use Dagger to inject into an android Annotated Activity. java.lang.IllegalArgumentException: No inject registered for members/com.app.server.AddServerActivity_. You must explicitly add it to the 'injects' option in one of your modules. If I try and Add the com.app.server.AddServerActivity_ to the module I get a diffrent error Error: java.lang.ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class java.lang.RuntimeException: java.lang.ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com

ClassNotFoundException using AndroidAnnotations

本秂侑毒 提交于 2019-12-04 09:09:06
I trying to use AndroidAnnotaions, but getting ClassNotFoundException error in my project. For testing purposes, I created a new project with one Activity and I still getting the error. My files: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.rodrigora.testannotations" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name"