Not targeting the latest versions of Android

It says this because of targetSdkVersion=”16″. API 16 is Jellybean 4.1 and 4.1.1, while Jellybean 4.2 is API 17. Try using: <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”17″ /> Also, keep in mind that this is a Lint warning. These warning exist to help you better your code and make it easy to maintain, while being compatible with the …

Read more

Does python have a “use strict;” and “use warnings;” like in perl?

To provide an answer that perhaps avoids a little of the commentary noise here, I’ll try another one. The two pragmata in your original question really expand to: use strict “vars”; use strict “refs”; use strict “subs”; use warnings; To answer each in turn: The effect of use strict “vars” is to cause a compile-time …

Read more

Treat all warnings as errors

MSBuild warnings (all start with MSB*) as opposed to CSC warnings cannot be suppressed nor promoted to errors. For the reason the ResolveAssemblyReference task prints its messages on the fly and does not aggregate any of them. The only feasible solution is reading the MSBuild log files created during the TFS build. I think the …

Read more

kotlin suppress warning deprecated for Android

Use @Suppress annotation with argument “DEPRECATION”: @Suppress(“DEPRECATION”) someObject.theDeprecatedFunction() Instead of a single statement, you can also mark a function, a class or a file (@file:Suppress(“DEPRECATION”) in its beginning) with the annotation to suppress all the deprecation warnings issued there. In IntelliJ IDEA this can also be done through Alt+Enter menu with caret placed on code …

Read more

Make javac treat warnings as errors

Use the -Werror flag. It’s not listed in the -help output, but it works. I found it through this blog entry and tested on my own code (in NetBeans with Ant). The output was: MyClass.java:38: warning: [serial] serializable class MyClass has no definition of serialVersionUID public class MyClass extends JComponent { 1 warning BUILD FAILED …

Read more

Class is a raw type. References to generic type Class should be parameterized

The interface declares the method with a raw type. In that case, you can’t override it nicely without having the warning. The origin of your problem is that the Spring interface was declared to be Java 1.4 compliant. Note that Spring 3.0 is supposed to deliver all classes as Java 1.5 compliant, so that would …

Read more

Is there any way to show, or throw, a PHP warning?

If you want to generate a warning, you should write trigger_error($yourErrorMessage, E_USER_WARNING); trigger_error() has the $error_type parameter for setting the error level (Notice, Warning or Fatal error). The constants are, respectively: E_USER_NOTICE // Notice (default) E_USER_WARNING // Warning E_USER_ERROR // Fatal Error Note that Fatal error stops the execution of subsequent PHP code, while Notice …

Read more