O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setup

The option we will be using is Retrolambda (https://github.com/orfjackal/retrolambda). We will enable it by using a plugin for Android (https://github.com/evant/gradle-retrolambda).

Don't forget that, before using Java 8 features, you have to have the Oracle JDK 8 downloaded and running.

It can be done by simply adding the following at the very top of the application's app/build.gradle file:

plugins {    id "me.tatarka.retrolambda" version "3.4.0"}apply plugin: 'com.android.application'

Also, let's not forget to tell the IDE that we will be using Java 8 by adding the following block:

android {    ...    compileOptions {        targetCompatibility 1.8        sourceCompatibility 1.8    }}

Finally, if proguard is being used, adding a line---dontwarn java.lang.invoke.* ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required