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

Creating the StorIO Observable

Finally, just by appending this to the .prepare() statement, we will create an Observable that will start returning data:

.asRxObservable()

However, we should keep in mind that this Observable is of the rx.Observable type from RxJava 1.0, so it cannot be used in our flow yet.

To make it usable, we should wrap it in the v2() function that we created so that the whole flow looks like this:

v2(StorIOFactory.get(this)        .get()        .listOfObjects(StockUpdate.class)        .withQuery(Query.builder()                .table(StockUpdateTable.TABLE)                .orderBy("date DESC")                .limit(50)                .build())        .prepare()        .asRxObservable())

The StorIO Observable that we've just created will start returning data, but there are a few more things that we need to do. ...

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