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

Emitting status updates into Observable

The final steps now left to take are to convert the preceding code into something that can be used in RxJava Observable flows.

We will do this using Observable.create() and by utilizing the Emitter interface.

Let's start by creating the given method:

Observable<Status> observeTwitterStream(Configuration configuration, FilterQuery filterQuery)

This will be responsible for the creation of such an Observable. Inside the methods, we will have a call to the Observable.create() call:

Observable<Status> observeTwitterStream(Configuration configuration, FilterQuery filterQuery) {    return Observable.create(emitter -> {    });}

This will provide us with a convenient interface where we will be able to specify ...

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