Introduction to Reactive Programming - RxJava and RxAndroid with samples plus comparison with plain old Java (Imperative) style of Programming. The following samples will have fundamental concepts that are required for getting started with Reactive Programming.
- BasicRxJavaSampleFragment - Basic
Observable,Observerand Subscription example. Emitting list of animal names. - RxJavaDisposableSampleFragment - Introduced Disposable to dispose the subscription.
- RxJavaOperatorSampleFragment - Introducing
filter()operator to filter out the animal names starting with letterb. - RxJavaCompositeSampleFragment - Introduced
CompositeDisposableandDisposableObserver. Also Example of chaining of operators.map()andfilter()operators are used together. - BasicRxJavaCompactSampleFragment - Basic
Observable,Observerwith inline subscriber that implements OnNext() and OnError() handlers
- APICallAsyncFragment - Using AsyncTask, making a network call (Just for comparison)
- APICallRxJavaFragment - Making similar network call using RxJava and iterating over list using
flatMap()
- APICallCoroutinesFragment - Making similar network call using
Coroutines(Again for comparison) - APICallHelperCoroutinesFragment - Making similar network call using
Coroutineswith helper methods (Again for comparison)
- Androidhive - Code samples and exaplanation
