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

Usage

You might think that setting all Retrolambda can be just too much trouble for very little gain. Nothing could be further from the truth and it will be obvious after we take a look at a few examples of code.

Compare the following two samples of code. The first sample is as follows:

Observable.just("1")        .subscribe(new Consumer<String>() {            @Override            public void accept(String e) {                Log.d("APP", "Hello " + e);            }        });

Here's the next sample:

Observable.just("1")        .subscribe(e -> Log.d("APP", "Hello " + e));

The latter is much more concise, but might fail to show the scale of the problem of the former approach. This example might be much better at doing so:

Observable.just("1")        .map(new Function<String, String>() {            @Override            public String ...

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