android-lint
Disable `lint` in Android gradle
Surely you can do this by adding this line in your gradle.properties file: gradle=build -x lint -x lintVitalRelease Warning: The above line will prevent running lint for both debug and release builds! If you want to find out more gradle hacks, speedy builds, performance improvements, this will be the best slides you’ll be looking at: … Read more
Meaning of “No label views point to this text field” warning message
The labelFor is an attribute for accessibility options. You assign this to a label so that if, on a form , user clicks a textedit field , android can know what to read (TalkBack) to user. The id you assigned to it doesn’t seem to be a valid one. why there are two @id in … Read more
Using FloatMath or Math and a cast?
As you can see from the results below, using java.lang.Math is faster for floats than for doubles, and faster than FloatMath. Furthermore, FloatMath has no .exp() or .pow() prior to API level 17. On a Samsung GT_i9295 (4.2.2), 2^24 cycles Math.exp(D) Total: 7405 ms, Per Op: 0.0004414 ms (F)Math.exp(F) Total: 5153 ms, Per Op: 0.0003071 … Read more
Understanding @SuppressLint(“NewApi”) annotation
@SuppressLint(“NewApi”) is an annotation used by the Android Lint tool. Lint will tell you whenever something in your code isn’t optimal or may crash. By passing NewApi there, you’re suppressing all warnings that would tell you if you’re using any API introduced after your minSdkVersion See a full list of Lint checks – including “NewApi” … Read more
Retrolambda: Lint crashes when using lambda expressions with retrolambda
You can use a special lombok version with lint which does not whine about Java 8 features. buildscript { repositories { jcenter() … } dependencies { classpath ‘com.android.tools.build:gradle:<version>’ classpath ‘me.tatarka:gradle-retrolambda:<version>’ classpath ‘me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2’ } // Exclude the version that the android plugin depends on. configurations.classpath.exclude group: ‘com.android.tools.external.lombok’ } This way you can keep running lint on … Read more
Run lint when building android studio projects
If you just want to configure your Android Studio project to run the lint check before the default run configuration without affecting how your gradle tasks are configured, you can follow these steps. Open the run configurations drop down and choose edit Select your app run configuration Press the ‘+’ to add a new step … Read more