RxJava versus Coroutines
Both RxJava and coroutines can be used for doing background tasks in Android, such as network calls or database operations.
Which one should you use then? While you can use both in your application, for example, RxJava for one task and coroutines for another, you can also use them together with LiveDataReactiveStreams
or kotlinx-coroutines-rx3
. This, however, will increase the number of dependencies you use and the size of your application.
So, RxJava or coroutines? The following table shows the differences between the two:
Let's move on to the next activity.
Activity 13.01: Creating a TV Guide App
A lot of people watch television. Most of the time, though, they are not sure what TV shows are currently on the air. Suppose you wanted to develop an app that can display a list of these shows from The Movie Database API's tv/on_the_air
endpoint using Kotlin...