X Tutup
Skip to content

Commit 118c330

Browse files
author
Kaushik Gopal
committed
chore: cleanup readme
1 parent 70e635f commit 118c330

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed

README.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,27 @@ Learning RxJava for Android by example
33

44
I've read and watched a lot on Rx. Most examples either use the J8 lambda notations/Scala/Groovy or some other awesome language that us Android developers are constantly envious of.
55

6-
Unfortunately i could never find real-world simple examples in Android, that could show me how to use RxJava in Android. This repo is a solution to that problem. Below are a list of examples with a little more details on the approach:
6+
Unfortunately i could never find real-world simple examples in Android, that could show me how to use RxJava in Android. This repo is a solution to that problem.
77

88
## Examples:
99

10-
### 1. Concurrency using schedulers
10+
### Concurrency using schedulers
1111

12-
A common requirement is to offload lengthy heavy I/O intensive operations to a background thread (non-UI thread), and feed the results back to the UI/main thread, on completion. This is a demo of how long running operations can be offloaded to a background thread. After the operation is done, we resume back on the main thread. All using RxJava! Think of this is as a replacement for AsyncTasks.
12+
A common requirement is to offload lengthy heavy I/O intensive operations to a background thread (non-UI thread), and feed the results back to the UI/main thread, on completion. This is a demo of how long running operations can be offloaded to a background thread. After the operation is done, we resume back on the main thread. All using RxJava! Think of this as a replacement to AsyncTasks.
1313

14-
The long operation is simulated by a blocking Thread.sleep call. But since it's in a background thread, our UI is never interrupted.
14+
The long operation is simulated by a blocking Thread.sleep call (since this is done in a background thread, our UI is never interrupted).
1515

1616
To really see this example shine. Hit the button multiple times and see how the button click (which is a ui operation) is never blocked because the long operation only runs in the background.
1717

18-
### 1. Retrofit and RxJava (zip, flatmap) (wip)
18+
### Instant/Auto searching (subject + debounce)
1919

20-
Working examples of github from JakeWharton's Retrofit preso at Netflix
21-
https://www.youtube.com/watch?v=aEuNBk1b5OE#t=2480
22-
https://speakerdeck.com/jakewharton/2014-1
23-
24-
### 1. simpler operations: map/collect (wip)
25-
26-
We have a list of three twitter handles. We wish to get the 3 latest tweets from each of these people, and print them out on our screen.
27-
28-
### 1. First retrieve from cached data, then make a network call if you can't find your data (concat) (wip)
29-
30-
[Courtesy: gist](https://gist.github.com/adelnizamutdinov/7483969)
31-
32-
### 1. Make two parallel network calls, then combine the result into a single data point (zip) (wip)
20+
This is a demo of how events can be swallowed in a way that only the last one is respected. A typical example of this is instant search result boxes. As you type the word "Bruce Lee", you don't want to execute searches for B, Br, Bru, Bruce, Bruce , Bruce L ... etc. But rather intelligently wait for a couple of moments, make sure the user has finished typing the whole word, and then shoot out a single call for "Bruce Lee".
3321

34-
[Courtesy: gist](https://gist.github.com/adelnizamutdinov/7483969)
35-
http://www.programmableweb.com/category/all/apis?order=field_popularity
22+
As you type in the input box, it will not shoot out log messages at every single input character change, but rather only pick the lastly emitted event (i.e. input) and log that.
3623

24+
This is the debounce/throttleWithTimeout method in RxJava.
3725

38-
### 1. Accumulate calls (buffer)
26+
### Accumulate calls (buffer)
3927

4028
This is a demo of how events can be accumulated using the "buffer" operation.
4129

@@ -48,15 +36,24 @@ Two implementations:
4836
2a. Using a traditional observable - but encompassing the OnClick within the observable
4937
2b. Using PublishSubject and sending single clicks to the Observable, which in-turn then sends it to the Observer
5038

51-
### 1. Instant/Auto searching (subject + debounce)
39+
## Work in Progress:
5240

53-
This is a demo of how events can be swallowed in a way that only the last one is respected. A typical example of this is instant search result boxes. As you type the word "Bruce Lee", you don't want to execute searches for B, Br, Bru, Bruce, Bruce , Bruce L ... etc. But rather intelligently wait for a couple of moments, make sure the user has finished typing the whole word, and then shoot out a single call for "Bruce Lee".
41+
### Retrofit and RxJava (zip, flatmap) (wip)
5442

55-
As you type in the input box, it will not shoot out log messages at every single input character change, but rather only pick the lastly emitted event (i.e. input) and log that.
43+
Working examples of github from JakeWharton's Retrofit preso at Netflix
44+
https://www.youtube.com/watch?v=aEuNBk1b5OE#t=2480
45+
https://speakerdeck.com/jakewharton/2014-1
5646

57-
This is the debounce/throttleWithTimeout method in RxJava.
47+
### First retrieve from cached data, then make a network call if you can't find your data (concat) (wip)
48+
49+
[Courtesy: gist](https://gist.github.com/adelnizamutdinov/7483969)
50+
51+
### Make two parallel network calls, then combine the result into a single data point (zip) (wip)
5852

59-
### 1. Orchestrating Observables (flatmap + zip) (wip)
53+
[Courtesy: gist](https://gist.github.com/adelnizamutdinov/7483969)
54+
http://www.programmableweb.com/category/all/apis?order=field_popularity
55+
56+
### Orchestrating Observables (flatmap + zip) (wip)
6057

6158
If actions A and B depend on action X running; and action C depends on action Y running. What if you want to combine the result of all those calls and have a single output?
6259

@@ -66,15 +63,13 @@ If actions A and B depend on action X running; and action C depends on action Y
6663
|
6764
Y ------------------------- C ________________|
6865

69-
70-
71-
### 1. Pagination (zip) (wip)
66+
### Pagination (zip) (wip)
7267

7368
a. Simple pagination
7469
b. Optimized pagination
7570

7671

7772

78-
### 1. Replacing your event Bus (wip)
73+
### Replacing your event Bus (wip)
7974

8075
http://stackoverflow.com/questions/19266834/rxjava-and-random-sporadic-events-on-android

0 commit comments

Comments
 (0)
X Tutup