RxJava Tutorial

RxJava Tutorial

RxJava is a Java based extension of ReactiveX. ReactiveX is a project which aims to provide reactive programming concept to various programming languages. Reactive programming can most simply be defined as asynchronous programming with observable streams. It is a event based programming concept and events can propagate to registers observers. As per the Reactive, they have combined the best of Observer pattern, Iterator pattern and functional pattern. The Observer pattern done right. ReactiveX is a combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming

Examples of Reactive programming scenarios

  • User-Generated Events: Click events, swipe events, keyboard input, device rotations… these are just a few examples of events initiated by the user. If we consider each of these events across a timeline, we can see how they would form an ordered sequence of events–a dynamic and potentially infinite data stream.
  •  I/O Operations: Network requests, file reads and writes, database accesses… I/O operations are probably the most common type of data streams you will apply reactive principles to in practice. I/O operations are asynchronous since they take some significant and uncertain amount of time to complete. The response–whether it be JSON, a byte array, or some plain-old Java objects–can then be treated as a data stream.
  • External System Events: Push notifications from the server, GCM broadcasts, updates from device sensors… events generated from external producers are similar to user-generated events in their dynamic and potentially infinite nature
  • Just About Anything: Really. Just about anything can be modeled as a data stream–that’s the reactive mantra. A single, scalar value or a list of objects… static data or dynamic events… any of these can be made into a data stream in the reactive world

 

*

RxJava Tutorial RxJava - Environment Setup RxJava’s Characteristics RxJava - How Observable works RxJava - Single Observable RxJava - MayBe Observable RxJava - Completable Observable RxJava - Using CompositeDisposable RxJava - Creating Operators RxJava - Transforming Operators RxJava - Filtering Operators RxJava - Combining Operators RxJava - Utility Operators RxJava - Conditional Operators RxJava - Mathematical Operators RxJava - Subjects RxJava - PublishSubject RxJava - BehaviorSubject RxJava - AsyncSubject RxJava - ReplaySubject RxJava - Schedulers RxJava - Trampoline Scheduler RxJava - NewThread Scheduler RxJava - Computation Scheduler RxJava - IO Scheduler RxJava - From Scheduler RxJava - Buffering