Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reactive programming in android

Kaushal Dhruw
November 26, 2017

Reactive programming in android

RxJava and RxAndroid for android app development. For viewing the session recording checkout yourtube channel DeveloperDru

https://www.youtube.com/channel/UC6Ql4x5QftDEMb8byAh_Q6g/videos

Kaushal Dhruw

November 26, 2017
Tweet

More Decks by Kaushal Dhruw

Other Decks in Technology

Transcript

  1. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved.

    Reactive programming in android Kaushal Dhruw @drulabs
  2. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 2 Agenda •  What is Reactive programming? And Why? •  Reactive extensions •  RxJava & RxAndroid •  Components of reactive programming •  Retrofit with RxJava •  Operators •  Testing
  3. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 3 Reactive programming •  Wikipedia –  It is an asynchronous programming paradigm concerned with data flows and propagation of change. •  In other words: –  Reactive programming is programming with asynchronous data streams.
  4. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 4 Why asynchronous? Because blocking UI is EVIL
  5. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 5 Why asynchronous? MyApp isn’t responding Jesus peeps you need to update this. worst game ever Did you even test this ? Is there a way to give -20 star? My dog can create a better app
  6. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 6 Reactive programming •  Wikipedia –  It is an asynchronous programming paradigm concerned with data flows and propagation of change. •  In other words: –  Reactive programming is programming with asynchronous data streams.
  7. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 7 Why Reactive? Idea from Jake Wharton’s Devoxx 2017 talk
  8. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 8 Reactive programming is… Observer pattern Iterator pattern Functional support And more…
  9. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 9 Reactive programming is… Observer pattern Iterator pattern Functional support Concurrency Resilience And more…
  10. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 10 Reactive programming Observer pattern Iterator pattern Functional support
  11. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 11 Reactive programming Observer pattern Functional support Iterator pattern
  12. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 12 Reactive programming Observer pattern Iterator pattern Functional support Create Combine Transform Chain Listen Filter Reduce Map
  13. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 13 Reactive Extensions (Rx) •  Reactive extensions (or Rx) is a library for composing asynchronous and event-based programs by using observable sequences
  14. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 14 Reactive Extensions (Rx) •  Reactive extensions (or Rx) is a library for composing and programs by using sequences simultaneous operations. perform some operation(s) when event is triggered or received. think of it as asynchronous immutable array.
  15. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 15 Reactive Extensions (Rx)
  16. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 16 RxJava & RxAndroid •  RxJava is a Java VM implementation of ReactiveX. •  RxAndroid provides android specific bindings and extensions so RxJava can be used in android applications
  17. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 17 Who uses Rx
  18. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 19 Components •  Source (emits data) – Emits data streams that can be passed between threads and consumed •  Subscriber (the observer or consumer) – Consumes data emitted from source •  Scheduler (threads and concurrency) –  Where to process and consume data
  19. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 20 Components Source (observable) Data => 1, 2, 3 From Network Database File Doesn’t ma9er Data received. Update UI Or local DB Subscriber (observer) Scheduler (concurrency) I/O thread UI thread ComputaGon thread subscribe dispose Time onNext(1) onNext(2) Error / complete onNext(3)
  20. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 21 Source Source (observable) Data => 1, 2, 3 From Network Database File Doesn’t ma9er Time onNext(1) onNext(2) Error / complete onNext(3)
  21. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 22 Source & Subscriber Source (observable) Data => 1, 2, 3 From Network Database File Doesn’t ma9er Time onNext(1) onNext(2) Error / complete onNext(3) Data received. Update UI Or local DB Subscriber (observer) subscribe dispose
  22. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 23 Schedulers Source (observable) Time Subscriber (observer) Scheduler (concurrency) I/O thread UI thread ComputaGon thread
  23. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 24 Schedulers Source (observable) Time Subscriber (observer) Scheduler (concurrency) I/O thread UI thread ComputaGon thread Abstract away concerns like: •  Low level threading •  SynchronizaGon •  Thread safety •  Concurrent data structure
  24. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 25 Schedulers Source (observable) Time Subscriber (observer) Scheduler (concurrency) I/O thread UI thread ComputaGon thread Decide where to execute what •  io() •  computa5on() •  newThread() •  from(Executer)
  25. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 26 Source, Subscriber & Scheduler Source (observable) Data => 1, 2, 3 From Network Database File Doesn’t ma9er Time onNext(1) onNext(2) Error / complete onNext(3) Data received. Update UI Or local DB Subscriber (observer) subscribe dispose Scheduler (concurrency) I/O thread UI thread ComputaGon thread
  26. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 27 Components Source (observable) Data => 1, 2, 3 From Network Database File Doesn’t ma9er Data received. Update UI Or local DB Subscriber (observer) Scheduler (concurrency) I/O thread UI thread ComputaGon thread subscribe dispose Time onNext(1) onNext(2) Error / complete onNext(3)
  27. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 29 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T>
  28. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 30 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Methods: •  onSubscribe(Disposable) •  onNext(T) •  onError(Throwable) •  onCompleted()
  29. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 31 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Multi-valued base reactive abstract class Use factory methods to create observables OnSubscribe is a param in create method
  30. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 32 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Unsubscribe from the source. Methods: •  dispose() •  isDisposed()
  31. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 33 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Functional interface that accepts a single value Methods: •  accept(T) Used with various single value functions
  32. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 34 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Interface for emitting signals Methods: •  onNext(T) •  onError(Throwable) •  onComplete()
  33. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 35 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Interface for composing source. Transforms source by applying a function Methods: •  Observable<R> apply(Observable<T>)
  34. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 36 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Parameterizes concurrency Methods: •  io() •  computation() •  newThread() •  from(Executer)
  35. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 37 RxJava2 Core types o  Observer<T> o  XSource<T> §  XOnSubscribe<T> o  Disposable o  Consumer<T> o  XEmitter<T> o  Transformer<T, R> o  Schedulers o  Subject<T> Advanced reactive concept. Acts as both source and subscriber Use with caution
  36. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 39 Source •  Observable<T> •  Flowable<T> •  Single<T> •  Maybe<T> •  Completable<T> •  ObservableSource<T> •  Publisher<T> •  SingleSource<T> •  MaybeSource<T> •  CompletableSource<T>
  37. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 40 Observable •  Observable<T> •  Flowable<T> •  Single<T> •  Maybe<T> •  Completable<T> Emits 0 to N items terminates with success or exception
  38. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 41 Flowable •  Observable<T> •  Flowable<T> •  Single<T> •  Maybe<T> •  Completable<T> Emits 0 to N items terminates with success or exception. Supports backpressure
  39. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 42 Single •  Observable<T> •  Flowable<T> •  Single<T> •  Maybe<T> •  Completable<T> Emits single item or error. Has no completion indicator
  40. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 43 Maybe •  Observable<T> •  Flowable<T> •  Single<T> •  Maybe<T> •  Completable<T> Succeeds with 0 or 1 item, or fails. Has completion indicator. Reactive optional.
  41. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 44 Completable •  Observable<T> •  Flowable<T> •  Single<T> •  Maybe<T> •  Completable<T> Completes with success or fails. No emission.
  42. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 45 That was a lot to take in •  Source (Observable) and subscriber are just a slight extension of standard Observer Pattern ? •  The real power comes with reactive extensions •  operators that allows us to transform, combine, manipulate, and work with the sequences of emitted items One question:
  43. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 47 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Just •  Range •  Repeat •  Start •  Timer
  44. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 48 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Create an Observable from scratch by calling observer methods programmatically
  45. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 49 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Create fresh observable for each observer and defer creation until observer subscribes
  46. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 50 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Create observable that emits no items but terminates: –  Normally –  Never –  With error
  47. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 51 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Convert some other object or data structure into an Observable (like list, array, publisher etc.)
  48. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 52 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Create an Observable that emits a sequence of integers spaced by a particular time interval
  49. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 53 Creational operators •  Create •  Defer •  Empty/Never/Error •  From •  Interval •  Just •  Range •  Repeat •  Start •  Timer
  50. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 54 Creational operators •  Just •  Range •  Repeat •  Start •  Timer •  Convert an object or a set of objects into an Observable that emits that or those objects
  51. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 55 Creational operators •  Just •  Range •  Repeat •  Start •  Timer •  Create an Observable that emits a range of sequential integers
  52. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 56 Creational operators •  Just •  Range •  Repeat •  Start •  Timer •  Create an Observable that emits a particular item or sequence of items repeatedly
  53. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 57 Creational operators •  Just •  Range •  Repeat •  Start •  Timer •  Create an Observable that emits the return value of a function
  54. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 58 Creational operators •  Just •  Range •  Repeat •  Start •  Timer •  Create an Observable that emits a single item after a given delay
  55. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 60 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  56. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 61 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  57. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 62 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  58. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 63 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  59. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 64 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  60. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 65 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  61. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 66 Transformational operators •  Buffer •  FlatMap •  GroupBy •  Map •  Scan •  Window
  62. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 68 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  63. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 69 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  64. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 70 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  65. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 71 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  66. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 72 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  67. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 73 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  68. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 74 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  69. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 75 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  70. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 76 Filtering operators •  Distinct •  ElementAt •  Filter •  First •  Last •  Skip •  Take •  TakeLast
  71. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 78 CombineLatest
  72. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 79 StartWith
  73. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 80 Zip
  74. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 81 Concat
  75. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 82 Merge
  76. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 83 Operator chaining Map Filter Merge
  77. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 84 Operator chaining Filter Reduce
  78. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 86 Retrofit with RxJava Pure retrofit
  79. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 87 Retrofit with RxJava Add RxJava2 Adapter Set RxJava2 call adapter factory
  80. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 88 Retrofit with RxJava Use RxJava2 with retrofit
  81. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 89 Make it Reactive… <code/> remote UI Idea from Jake Wharton’s Devoxx 2017 talk <code/> remote UI
  82. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 90 Testing with RxJava •  TestObserser •  TestSubscriber •  TestScheduler RxJava2 provides the following:
  83. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 91 Demo Android app
  84. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 92 Thank you -Kaushal Dhruw @drulabs – twi]er / github / stackoverflow / medium Demo app available at h]ps://github.com/drulabs/PicBlast
  85. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 93 Next meetup suggestions •  RxKotlin with RxJava (android app development) •  RxSwift (iOS app development) •  Effective MVP using Dagger, Retrofit and RxJava •  Android architecture components
  86. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 94 References •  http://reactivex.io/documentation •  http://reactivemanifesto.org/ •  https://github.com/ReactiveX/RxJava/wiki •  https://medium.com/@andrestaltz/2-minute-introduction-to-rx-24c8ca793877 •  http://rxmarbles.com/ •  https://christinalee.github.io/Slides/slides-master/rx-android/ •  https://medium.com/@benlesh/hot-vs-cold-observables-f8094ed53339 •  https://github.com/Froussios/Intro-To-RxJava •  https://praveer09.github.io/ •  https://www.slideshare.net/allegrotech/rxjava-introduction-context •  https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 •  http://www.vogella.com/tutorials/RxJava/article.html •  https://github.com/ReactiveX/RxJava •  BackPressure: https://github.com/ReactiveX/RxJava/wiki/Backpressure
  87. Copyright © 2016 Talen5ca So8ware (I) Pvt Ltd. All rights

    reserved. Copyright ©2016 Talen5ca So8ware (I) Pvt Ltd. All rights reserved. 95 Backup slides