Fast way to setup Retrolambda on an android project.
Retrolambda is a library which allows to use Java 8 lambda expressions, method references and try-with-resources statements on Java 7, 6 or 5.
The Gradle Retrolambda Plug-in allows to integrate Retrolambda into a Gradle based build. This allows for example to use these constructs in an Android application, as standard Android development currently does not yet support Java 8.
Setup and example how to use:
Download and install jdk8.
Add the following to your project’s main build.gradle
Now add this to your application module’s build.gradle
Add these lines to your application module’s build.gradle to inform the IDE of the language level:
So things like this: