To get a feel for RxJava, let's rewrite the previously written temperature sensing application with RxJava. To use the library in the application, let's add the following dependency to the build.gradle file:
compile('io.reactivex:rxjava:1.3.8')
Here, we are using the same value class to represent the current temperature, as shown in the following code:
final class Temperature { private final double value; // constructor & getter }