Hello Readers, Today, I am going to start a new page on my website about Rx. Here we will do two things.
1. Learning Rx
2. Implementation of Rx in real scenarios
Here, our expectation from the readers, they already know about the basics of Rx.
If you are a beginner, I will recommend reading my other series on Rx first.
- Observer Pattern Part1
- Pull vs Push & Imperative vs Reactive Part2
- Functional Interfaces, Default Methods, { Higher Order – Pure – Side Effects in } + Functions, Im + { Mutable } , Lambda Expression & Functional Programming Part3
- War against Learning Curve of Rx Java 2 + Java 8 Stream Part4
- Dialogue between Rx Observable and a Developer (Me) Part5
- Continuation (Summer vs Winter Observable) of Dialogue between Rx Observable and a Developer (Me) Part6
- Continuation (Observable Marriage Proposal to Observer) of Dialogue between Rx Observable and a Developer (Me) Part7
- Confusion between Subject and Observable + Observer Part8
Now, how “Learning Rx” and “Implementation of Rx in real scenarios,” both will intersect each other?
We will take real-world scenarios or maybe application requirements which we will implement in Rx. This part belongs to “Implementation of Rx in real scenarios.”
As we know, we need to use some construct from Rx in this implementation; we will create a separate blog of that construct that will belong to “Learning Rx.”
Limitations:
- In a real scenario example, we are not allowed to use the Imperative Code.
- Learning Rx posts will contain those operators which we will use in Real Scenarios.
Learning Rx:
- Serial Disposable & Composite Disposable
- interval
- merge
- switchMap
- takeWhile
- Subject, PublishSubject, BehaviourSubject
- Subject as a Proxy Pattern | Rx Stream, Please Survive, on a Device Rotation
- Observable.empty()
Implementation of Rx in real scenarios:
- Android StopWatch App:
This implementation will use CompositeDisposable, merge, interval, swictMap, takeWhile, Observable.empty(), PublishSubject, BehaviousSubject, Subject as a ProxyPattern from Rx. Or you can say, that is the prerequisite. I will create a post on all of these concepts or operators in Learning Rx but for now. I will use these in our Android StopWatch App and will post later.
Requirement:- v1: (V1-Android StopWatch ( New Era of Rx ))
Create an App which contains two buttons Start & Reset. When Start click, the timer will start and shown on the screen with Start Button Disable and Reset Button Enable. Max 60 min timer is allowed after that stopwatch automatically stop. - v2:
Add Pause button, when Pause Button click, timer should pause and when the user clicks Start again, timer should resume. - v3:
In version 3, the App should support landscape and portrait mode. If the timer is running and the user does rotate the device. The App should manage the states. - v4:
Code quality should be good. We need the maximum unit and functional test coverage.
- v1: (V1-Android StopWatch ( New Era of Rx ))