Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, September 19, 2017

Future of Java 8 Language Feature Support on Android

Future of Java 8 Language Feature Support on Android



Posted by James Lau, Product Manager 




At Google, we always try to do the right thing. Sometimes this means adjusting
our plans. We know how much our Android developer community cares about good
support for Java 8 language features, and were changing the way we support
them.





Weve decided to add support for Java 8 language features directly into the
current javac and dx set of tools, and deprecate the Jack toolchain. With this
new direction, existing tools and plugins dependent on the Java class file
format should continue to work. Moving forward, Java 8 language features will be
natively supported by the Android build system. Were aiming to launch this as
part of Android Studio in the coming weeks, and we wanted to share this decision
early with you.




We initially tested adding Java 8 support via the Jack toolchain. Over time, we
realized the cost of switching to Jack was too high for our community when we
considered the annotation processors, bytecode analyzers and rewriters impacted.
Thank you for trying the Jack toolchain and giving us great feedback. You can
continue using Jack to build your Java 8 code until we release the new support.
Migrating from Jack should require little or no work.




We hope the new plan will pave a smooth path for everybody to take advantage of
Java 8 language features on Android. Well share more details when we release
the new support in Android Studio.


download file now

Read more »

Thursday, August 3, 2017

Java 8 Language Features Support Update

Java 8 Language Features Support Update



Posted by James Lau, Product Manager



Yesterday, we released Android Studio
2.4 Preview 6. Java 8 language features are now supported by the Android
build system in the javac/dx compilation path. Android Studios Gradle plugin
now desugars Java 8 class files to Java 7-compatible class files, so you can use
lambdas,
method references and other features of Java 8.




For those of you who tried the Jack compiler, we now support the same set of
Java 8 language features but with faster build speed. You can use Java 8
language features together with tools that rely on bytecode, including Instant
Run. Using libraries written with Java 8 is also supported.




We first added Java 8 desugaring in Android Studio 2.4 Preview 4. Preview 6
includes important bug fixes related to Java 8 language features support. Many
of these fixes were made in response to bug reports you filed. We really
appreciate your help in improving Android development tools for the community!




Its easy to try using Java 8 language features in your Android project. Just
download Android Studio
2.4 Preview 6, and update your projects target and source compatibility to
Java version 1.8. You can find more information in our preview
documentation.




Happy lambdaing!

download file now

Read more »