android-annotations

RequiresApi vs TargetApi android annotations

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 18:04:49
Whats the difference between RequiresApi and TargetApi ? Sample in kotlin: @RequiresApi(api = Build.VERSION_CODES.M) @TargetApi(Build.VERSION_CODES.M) class FingerprintHandlerM() : FingerprintManager.AuthenticationCallback() NOTE: FingerprintManager.AuthenticationCallback requires api M NOTE 2: if I dont use TargetApi lint fail with error class requires api level 23... @RequiresApi - Denotes that the annotated element should only be called on the given API level or higher. @TargetApi - Indicates that Lint should treat this type as targeting a given API level, no matter what the project target

Spring Rest Template usage causes EOFException

[亡魂溺海] 提交于 2019-11-28 15:19:19
问题 I'm receiving java.io.EOFException 's when using Spring REST template on Android. The stacktrace cause reads like this: Caused by: java.io.EOFException at libcore.io.Streams.readAsciiLine(Streams.java:203) at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560) at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813) at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274) at libcore.net.http.HttpURLConnectionImpl.getResponseCode

ClassNotFoundException on AndroidAnnotations generated classes since update to ADT 22

旧巷老猫 提交于 2019-11-27 22:55:42
This project worked wonders before updating to ADT22. I already lost a day because of not knowing I had to download build tools , and I'm afraid I'm going to loose another one because of this. When I try to build the same code that was working two days ago, I get this exception: com.cidaut.blueparking fatal error : Unable to instantiate activity \ ComponentInfo{com.cidaut.blueparking/com.cidaut.blueparking.SplashScreen_}: \ java.lang.ClassNotFoundException: \ Didn't find class "com.cidaut.blueparking.SplashScreen_" on path: \ /data/app/com.cidaut.blueparking-1.apk java.lang.RuntimeException:

RequiresApi vs TargetApi android annotations

一世执手 提交于 2019-11-27 20:13:57
问题 Whats the difference between RequiresApi and TargetApi ? Sample in kotlin: @RequiresApi(api = Build.VERSION_CODES.M) @TargetApi(Build.VERSION_CODES.M) class FingerprintHandlerM() : FingerprintManager.AuthenticationCallback() NOTE: FingerprintManager.AuthenticationCallback requires api M NOTE 2: if I dont use TargetApi lint fail with error class requires api level 23... 回答1: @RequiresApi - Denotes that the annotated element should only be called on the given API level or higher. @TargetApi -

Gradle + Annotations + Flavors = won't run annotations processor

最后都变了- 提交于 2019-11-27 17:42:25
问题 I have a Gradle build script that is using an annotations processor (Android Annotations) to generate code. Building was fine until I added a new Pro Flavor. I can build the Free flavor but when I build the Pro flavor the annotations processor isn't run. This causes missing code and the build fails. Here is my script: buildscript { repositories { maven { url 'http://repo1.maven.org/maven2' } } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android'