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

File-based caching example

Quite often, there is a need to cache some kind of results between the runs of the application. The most convenient way to do this on Android is a through basic file-based caching. This means that the result is computed, saved to the file, and--if it's needed again--read from the file directly instead of recomputing it again.

Usually, developers use this to save user credentials between the different sessions so that the users will not have to log in by entering their data again.

We will see how we can easily use the ObservableTranformer interface to create a universal file caching mechanism.

First of all, the FileCacheObservableTransformer should be created in the packt.reactivestocks package (or any other, according ...

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