Skip to content

Example of using RxJava and Retrofit to create an API mashup with Observable.zip()

License

Notifications You must be signed in to change notification settings

colintheshots/RxRetrofitMashup

Repository files navigation

RxRetrofitMashup

This is an example of using RxJava and Retrofit to combine the results of multiple, chained, combined, asynchronous network calls into the same UI. Doing this same task using traditional Android API threading methods and state variables is fraught by peril.

This example could also be solved with Observable.zip(), which we used in an earlier example. However, .groupBy allows us to create a series of keyed, anonymous Observables which can be flatmapped and subscribed together so the code is cleaner.

Consider Observable.zip() when you want to mash up dissimilar API sources. The zip() function allows one to manipulate and transform the network results of each input type before returning a new type which can more closely match your UI's data model.

About

Example of using RxJava and Retrofit to create an API mashup with Observable.zip()

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages