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

Intro to Reactive Java on Android

Intro to Reactive Java on Android

Presented on Jogja.APK #1 Meetup

Akhyar Amarullah

December 17, 2014
Tweet

More Decks by Akhyar Amarullah

Other Decks in Programming

Transcript

  1. RxJava https://github.com/ReactiveX/RxJava • Java VM implementation of Reactive Extension. •

    Reactive Extension is a library for composing asynchronous process using observable sequences
  2. "Why RxJava?" • Avoid callback hell • Easy compose and

    transform async processes. Chaining, combining, filtering, etc • Sane error handling • It's cool :p
  3. Usage example on Android apps • Combining several REST API

    calls together.
 e.g. all blog posts + author detail + comment list • Chaining several sequential processes.
 e.g. Mobile login process: 1. Send username/password to request access token from web service 2. Cache access token to local DB for further requests 3. Get user profile and preferences from web service and cache it
  4. More trivial usage examples • Offloading heavy blocking process to

    new thread and show the result in UI thread. • To get rid of that annoying AsyncTask • Giving some delay when showing splash screen :p