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

Observables

Everything starts with an Observable. It's a source of data that you can observe for emitted data (hence the name). In almost all cases (at least in this book), you will be working with the Observable class. It is possible to (and we will!) combine different Observables into one Observable. Basically, it is a universal interface to tap into data streams in a reactive way.

There are lots of different ways of how one can create Observables. The simplest way is to use the .just() method like we did before:

Observable.just("First item", "Second item");

It is usually a perfect way to glue non-Rx-like parts of the code to Rx compatible flow.

When an Observable is created, it is not usually defined when it will start emitting data. ...

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