Today, Google has updated development tools for eclipse under the Android platform.
One of the key changes is java 7 support.
Very often the question arose: when will the constructions of the Java 7 language be supported? On October 31, 2013, an update of Android Studio 0.3.2 was released, which brought the possibility of using these buns.
Today, finally, an update for ADT has been released, which allows using them in eclipse as well.
Support includes language features such as:
- String in switch-case expressions;
- Abbreviated description of generics (diamond operator <>);
- Exception handling for several types (catch (E1 | E2 e));
- Underscores in numeric constants (1_234_567);
- Binary constants (0b0001).
- Automatic resource management (try-with-resources)
The use of these features has become available for Android 2.2 and later. However, the design for automatic release of resources “try-with-resources” is available only for Android 4.4.
To use the new features, you need to upgrade to ADT 22.6.0 and specify the Java Compiler 1.7 in the project settings.
In addition to java 7, fixed bugs and added a couple of new lint checks:
- Check for potential vulnerabilities against SecureRandom .
- Check that the result of the checkPermission function is used.
- Check that the release build does not use the mock location provider.
A full list of changes and improvements is available at the links: