SlideShare a Scribd company logo
RxJava:
Functional Reactive
Programming on Android
Alexey Chernin, Software Developer
Based on:
“What does it mean to be Reactive” - Erik Meijer
“Rx-Fy all the things!” - Benjamin Augustin
“RxJava Easy Wins” - Ron Shapiro
“Android reactive programming with Rxjava”
- Ivan Morgillo
“Rx in 15 Minutes” - Erik Meijer
“Functional Reactive Programming in the Netflix API”
- Ben Christensen
Based on:
"RxJava Essentials" by
Ivan Morgillo, May 2015
“Реактивный двигатель для вашего Android приложения”
- Матвей Мальков
https://github.com/ReactiveX/RxJava/wiki
“Learning RxJava (for Android) by example” - Kaushik Gopal
“Reactive Programming in Java 8 With RxJava”
- Russell Elledge
“Rx Workshop”
Reactive Systems are:
 Responsive: The system responds in a timely manner if at all possible.
 Resilient: The system stays responsive in the face of failure.
 Elastic: The system stays responsive under varying workload.
 Message Driven: Reactive Systems rely on asynchronous message-passing to
establish a boundary between components that ensures loose coupling, isolation,
location transparency, and provides the means to delegate errors as messages.
Published on September 16 2014. (v2.0)
The Reactive Manifesto
www.reactivemanifesto.org
Functional reactive programming is an idea from the late 90s
that inspired Erik Meijer, a computer scientist at Microsoft, to
design and develop the Microsoft Rx library.
From .NET to RxJava
In 2012, at Netflix, they started to port .NET Rx to the JVM.
With a post on the Netflix tech blog in February 2013, Ben
Christensen and Jafar Husain showed RxJava to the world
for the first time.
“Reactive programming is a programming paradigm based on the concept
of an asynchronous data flow. A data flow is like a river: it can be observed,
filtered, manipulated, or merged with a second flow to create a new flow for
a new consumer”. Ivan Morgillo
Pure functions always returns the same result for a given set of parameter values.
 No side effects caused by Class or Instance state.
 No side effects caused by I/O devices.
 No time related side effects.
Pure functions
Pure functions: example 1
• Store function as a variable
• Pass a function as a parameter
• Function can return a function
 Composition
 Lazy execution
Pure functions: example 2
Butter Knife by Jake Wharton
Retrofit by Square
Why Retrofit?
https://instructure.github.io/blog/2013/12/09/volley-vs-retrofit
Supports:
• Gson - JSON serialization.
• Simple - XML serialization.
• OkHttp - HTTP client.
• Robospice - asynchronous network requests.
Fast:
“Retrofit” - Jacob Tabak
“A Few Ok Libraries”
- Jake Wharton
The old way
o Extend AsyncTask to make HTTP request in background
o Build the query string from array of NameValuePairs (12 lines)
o Read InputStream into String (20 lines)
o Parse JSON (75 lines)
The rxjava-android module contains Android-specific bindings for RxJava. It
adds a number of classes to RxJava to assist in writing reactive components in
Android applications.
o It provides a Scheduler that schedules an Observable on a given Android
Handler thread, particularly the main UI thread.
o It provides operators that make it easier to deal with Fragment and Activity
life-cycle callbacks.
o It provides wrappers for various Android messaging and notification
components so that they can be lifted into an Rx call chain.
o It provides reusable, self-contained, reactive components for common
Android use cases and UI concerns. (coming soon).
The RxJava Android Module
Gradle and Maven Retrolambda Plugin
Project dependencies
o Observables and Iterables share a
similar API.
o Observable is the push equivalent of
Iterable, which is pull.
Iterable and Observable
With Iterable, the consumer synchronously pulls values from the producer
and the thread is blocked until these values arrive. By contrast, with
Observable, the producer asynchronously pushes values to the Observer
whenever values are available.
The Observer pattern is the perfect fit for any of these scenarios:
o When your architecture has two entities, one depending on the other, and you want to
keep them separated to change them or reuse them independently.
o When a changing object has to notify an unknown amount of related objects about its
own
o change.
o When a changing object has to notify other objects without making assumptions about
who these objects are.
Observer pattern
Observer and Subscription
Types of Observables
Subject
A subject is a object that can be an Observable and an Observer at the
same time. A subject can subscribe to an Observable, acting like an
Observer, and it can emit new items or even pass through the item it
received, acting like an Observable.
RxJava provides four different types of subjects:
o PublishSubject - emits all subsequently observed items to the
subscriber, once an Observer has subscribed.
o BehaviorSubject - emits the most recent item it has observed and all
subsequent observed items to each subscribed Observer.
o ReplaySubject - buffers all items it observes and replays them to any
Observer that subscribes.
o AsyncSubject - publishes only the last item observed to each
Observer that has subscribed, when the source Observable completes.
Schedulers
Observable creation
Observable creation: examples
o Observable.just("one", "two", "three");
o Observable.just("one", "two", "three").repeat(3);
o Observable.range(10, 3); - Takes two numbers as parameters: the first
one is the starting point, and the second one is the amount of numbers we
want to emit.
o Observable.interval(3, TimeUnit.SECONDS); - Takes two parameters: a
number that specifies the amount of time between two emissions, and the
unit of time to be used.
o Observable.timer(3, 3, TimeUnit.SECONDS); - Starts with an initial delay
(3 seconds in the example) and then keeps on emitting a new number
every N seconds (3 in the example).
Marble diagram
Transformations: one to one
Transformations: one to many
Transformations: scanning
Transformations: group by
Transformations: buffer
Filtering Observables
Observable.just("one", "two", "three").filter((s)->{
return !s.equals("two");
});
Filtering Observables
sample() creates a new Observable sequence that will emit the most recent item
emitted by the Observable source in a decided time interval.
Filtering Observables
debounce() starts its internal timer,
and if no new item is emitted during
this timespan, the last item is
emitted by the new Observable.
Combining Observables
Death to AsyncTasks
Example
Example
Example
Well documented
Questions?
Thank you for your attention

More Related Content

PDF
Intro to Rx Java
Syed Awais Mazhar Bukhari
 
PDF
Rx java workshop
Mayowa Egbewunmi
 
PDF
The Mayans Lost Guide to RxJava on Android
Fernando Cejas
 
PPTX
Angular 2.0 change detection
Ran Wahle
 
PPTX
Strange Async Code - ReaxtiveX
Matthew Will
 
PDF
Reactive java - Reactive Programming + RxJava
NexThoughts Technologies
 
PPTX
RxJava 2 Reactive extensions for the JVM
Netesh Kumar
 
PDF
Java Week2(C) Notepad
Chaitanya Rajkumar Limmala
 
Intro to Rx Java
Syed Awais Mazhar Bukhari
 
Rx java workshop
Mayowa Egbewunmi
 
The Mayans Lost Guide to RxJava on Android
Fernando Cejas
 
Angular 2.0 change detection
Ran Wahle
 
Strange Async Code - ReaxtiveX
Matthew Will
 
Reactive java - Reactive Programming + RxJava
NexThoughts Technologies
 
RxJava 2 Reactive extensions for the JVM
Netesh Kumar
 
Java Week2(C) Notepad
Chaitanya Rajkumar Limmala
 

Viewers also liked (20)

PPTX
Centurylink Enterprise Cloud & Network
Jake Weaver
 
PDF
програма геометрія 7 кл. 2015
Иван Лаврусенко
 
DOCX
Brian stoke
Bhagwan Das
 
PDF
Europese regelgeving ventilatieproducten | verordening 1253/2014 |AL-KO Lucht...
duurzame verhalen
 
PPTX
Tieto Retail Experience - How will the retail remain relevant for all of us?
Tieto Corporation
 
PDF
"The (in)visible UX" - Claudio Beatrice
nois3
 
PDF
Getting hands dirty with php7
Michelangelo van Dam
 
PDF
Journey’s end
juanazufriategui
 
PDF
Corrientes geograficas 2016
Sol Maria Pardo Santayana
 
PPS
Globalisation
khooky
 
PPT
Literary devices s1
Pato_Ch
 
PDF
"Codesign Tools and Techniques” - Alessio Ricco
nois3
 
PDF
Intro to Lean UX: How to do it quick & dirty - Workshop [6h]
Melissa Ng
 
PPT
Η ΔΥΝΑΜΗ ΤΗΣ ΣΚΕΨΗΣ
Vassilis (BIll) Panopoulos M.B.A., M.H.R.M., M.M.M.
 
PPTX
Intelligent IoT Gateway on OpenWrt
Tieto Corporation
 
PDF
Derechos de los niños
jperezmuniz
 
PDF
History S4 Esquema de contenidos nodales Dic 2016
lennyambrosini
 
PDF
History S5 Esquema de contenidos nodales Dic 2016
lennyambrosini
 
PPTX
Brand Management: Nike
Jessica McCarthy
 
Centurylink Enterprise Cloud & Network
Jake Weaver
 
програма геометрія 7 кл. 2015
Иван Лаврусенко
 
Brian stoke
Bhagwan Das
 
Europese regelgeving ventilatieproducten | verordening 1253/2014 |AL-KO Lucht...
duurzame verhalen
 
Tieto Retail Experience - How will the retail remain relevant for all of us?
Tieto Corporation
 
"The (in)visible UX" - Claudio Beatrice
nois3
 
Getting hands dirty with php7
Michelangelo van Dam
 
Journey’s end
juanazufriategui
 
Corrientes geograficas 2016
Sol Maria Pardo Santayana
 
Globalisation
khooky
 
Literary devices s1
Pato_Ch
 
"Codesign Tools and Techniques” - Alessio Ricco
nois3
 
Intro to Lean UX: How to do it quick & dirty - Workshop [6h]
Melissa Ng
 
Η ΔΥΝΑΜΗ ΤΗΣ ΣΚΕΨΗΣ
Vassilis (BIll) Panopoulos M.B.A., M.H.R.M., M.M.M.
 
Intelligent IoT Gateway on OpenWrt
Tieto Corporation
 
Derechos de los niños
jperezmuniz
 
History S4 Esquema de contenidos nodales Dic 2016
lennyambrosini
 
History S5 Esquema de contenidos nodales Dic 2016
lennyambrosini
 
Brand Management: Nike
Jessica McCarthy
 
Ad

Similar to Sperasoft Talks: RxJava Functional Reactive Programming on Android (20)

PDF
RxJava@Android
Maxim Volgin
 
PPTX
Орхан Гасимов: "Reactive Applications in Java with Akka"
Anna Shymchenko
 
PPTX
Reactive Programming on Android - RxAndroid - RxJava
Ali Muzaffar
 
PPTX
Observer pattern
anshu_atri
 
PDF
RxJava@DAUG
Maxim Volgin
 
PDF
Guide to Spring Reactive Programming using WebFlux
Inexture Solutions
 
PDF
Streams, Streams Everywhere! An Introduction to Rx
Andrzej Sitek
 
PPTX
RxJava2 Slides
YarikS
 
PPTX
Reactive programming with rx java
CongTrung Vnit
 
PDF
IPT Reactive Java IoT Demo - BGOUG 2018
Trayan Iliev
 
PPTX
Microservices Part 4: Functional Reactive Programming
Araf Karsh Hamid
 
PPTX
Functional reactive programming
Araf Karsh Hamid
 
PDF
Reactive Applications in Java
Alexander Mrynskyi
 
ODP
Drilling the Async Library
Knoldus Inc.
 
PDF
IPT High Performance Reactive Java BGOUG 2016
Trayan Iliev
 
PPT
Reactive java programming for the impatient
Grant Steinfeld
 
PPTX
Reactive programming with RxAndroid
Savvycom Savvycom
 
PPTX
Rxandroid
Thinh Thanh
 
PPTX
RxAndroid
Thinh Thanh
 
ODP
Reactors.io
Knoldus Inc.
 
RxJava@Android
Maxim Volgin
 
Орхан Гасимов: "Reactive Applications in Java with Akka"
Anna Shymchenko
 
Reactive Programming on Android - RxAndroid - RxJava
Ali Muzaffar
 
Observer pattern
anshu_atri
 
RxJava@DAUG
Maxim Volgin
 
Guide to Spring Reactive Programming using WebFlux
Inexture Solutions
 
Streams, Streams Everywhere! An Introduction to Rx
Andrzej Sitek
 
RxJava2 Slides
YarikS
 
Reactive programming with rx java
CongTrung Vnit
 
IPT Reactive Java IoT Demo - BGOUG 2018
Trayan Iliev
 
Microservices Part 4: Functional Reactive Programming
Araf Karsh Hamid
 
Functional reactive programming
Araf Karsh Hamid
 
Reactive Applications in Java
Alexander Mrynskyi
 
Drilling the Async Library
Knoldus Inc.
 
IPT High Performance Reactive Java BGOUG 2016
Trayan Iliev
 
Reactive java programming for the impatient
Grant Steinfeld
 
Reactive programming with RxAndroid
Savvycom Savvycom
 
Rxandroid
Thinh Thanh
 
RxAndroid
Thinh Thanh
 
Reactors.io
Knoldus Inc.
 
Ad

More from Sperasoft (20)

PDF
особенности работы с Locomotion в Unreal Engine 4
Sperasoft
 
PDF
концепт и архитектура геймплея в Creach: The Depleted World
Sperasoft
 
PPTX
Опыт разработки VR игры для UE4
Sperasoft
 
PPTX
Организация работы с UE4 в команде до 20 человек
Sperasoft
 
PPTX
Gameplay Tags
Sperasoft
 
PDF
Data Driven Gameplay in UE4
Sperasoft
 
PPTX
Code and Memory Optimisation Tricks
Sperasoft
 
PPTX
The theory of relational databases
Sperasoft
 
PPTX
Automated layout testing using Galen Framework
Sperasoft
 
PDF
Sperasoft talks: Android Security Threats
Sperasoft
 
PDF
Sperasoft‬ talks j point 2015
Sperasoft
 
PDF
Effective Мeetings
Sperasoft
 
PDF
Unreal Engine 4 Introduction
Sperasoft
 
PDF
JIRA Development
Sperasoft
 
PDF
Introduction to Elasticsearch
Sperasoft
 
PDF
MOBILE DEVELOPMENT with HTML, CSS and JS
Sperasoft
 
PDF
Quick Intro Into Kanban
Sperasoft
 
PDF
ECMAScript 6 Review
Sperasoft
 
PDF
Console Development in 15 minutes
Sperasoft
 
PDF
Database Indexes
Sperasoft
 
особенности работы с Locomotion в Unreal Engine 4
Sperasoft
 
концепт и архитектура геймплея в Creach: The Depleted World
Sperasoft
 
Опыт разработки VR игры для UE4
Sperasoft
 
Организация работы с UE4 в команде до 20 человек
Sperasoft
 
Gameplay Tags
Sperasoft
 
Data Driven Gameplay in UE4
Sperasoft
 
Code and Memory Optimisation Tricks
Sperasoft
 
The theory of relational databases
Sperasoft
 
Automated layout testing using Galen Framework
Sperasoft
 
Sperasoft talks: Android Security Threats
Sperasoft
 
Sperasoft‬ talks j point 2015
Sperasoft
 
Effective Мeetings
Sperasoft
 
Unreal Engine 4 Introduction
Sperasoft
 
JIRA Development
Sperasoft
 
Introduction to Elasticsearch
Sperasoft
 
MOBILE DEVELOPMENT with HTML, CSS and JS
Sperasoft
 
Quick Intro Into Kanban
Sperasoft
 
ECMAScript 6 Review
Sperasoft
 
Console Development in 15 minutes
Sperasoft
 
Database Indexes
Sperasoft
 

Recently uploaded (20)

PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPT
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
This slide provides an overview Technology
mineshkharadi333
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 

Sperasoft Talks: RxJava Functional Reactive Programming on Android

  • 1. RxJava: Functional Reactive Programming on Android Alexey Chernin, Software Developer
  • 2. Based on: “What does it mean to be Reactive” - Erik Meijer “Rx-Fy all the things!” - Benjamin Augustin “RxJava Easy Wins” - Ron Shapiro “Android reactive programming with Rxjava” - Ivan Morgillo “Rx in 15 Minutes” - Erik Meijer “Functional Reactive Programming in the Netflix API” - Ben Christensen
  • 3. Based on: "RxJava Essentials" by Ivan Morgillo, May 2015 “Реактивный двигатель для вашего Android приложения” - Матвей Мальков https://github.com/ReactiveX/RxJava/wiki “Learning RxJava (for Android) by example” - Kaushik Gopal “Reactive Programming in Java 8 With RxJava” - Russell Elledge “Rx Workshop”
  • 4. Reactive Systems are:  Responsive: The system responds in a timely manner if at all possible.  Resilient: The system stays responsive in the face of failure.  Elastic: The system stays responsive under varying workload.  Message Driven: Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation, location transparency, and provides the means to delegate errors as messages. Published on September 16 2014. (v2.0) The Reactive Manifesto www.reactivemanifesto.org
  • 5. Functional reactive programming is an idea from the late 90s that inspired Erik Meijer, a computer scientist at Microsoft, to design and develop the Microsoft Rx library. From .NET to RxJava In 2012, at Netflix, they started to port .NET Rx to the JVM. With a post on the Netflix tech blog in February 2013, Ben Christensen and Jafar Husain showed RxJava to the world for the first time. “Reactive programming is a programming paradigm based on the concept of an asynchronous data flow. A data flow is like a river: it can be observed, filtered, manipulated, or merged with a second flow to create a new flow for a new consumer”. Ivan Morgillo
  • 6. Pure functions always returns the same result for a given set of parameter values.  No side effects caused by Class or Instance state.  No side effects caused by I/O devices.  No time related side effects. Pure functions
  • 8. • Store function as a variable • Pass a function as a parameter • Function can return a function  Composition  Lazy execution Pure functions: example 2
  • 9. Butter Knife by Jake Wharton
  • 11. Why Retrofit? https://instructure.github.io/blog/2013/12/09/volley-vs-retrofit Supports: • Gson - JSON serialization. • Simple - XML serialization. • OkHttp - HTTP client. • Robospice - asynchronous network requests. Fast: “Retrofit” - Jacob Tabak “A Few Ok Libraries” - Jake Wharton
  • 12. The old way o Extend AsyncTask to make HTTP request in background o Build the query string from array of NameValuePairs (12 lines) o Read InputStream into String (20 lines) o Parse JSON (75 lines)
  • 13. The rxjava-android module contains Android-specific bindings for RxJava. It adds a number of classes to RxJava to assist in writing reactive components in Android applications. o It provides a Scheduler that schedules an Observable on a given Android Handler thread, particularly the main UI thread. o It provides operators that make it easier to deal with Fragment and Activity life-cycle callbacks. o It provides wrappers for various Android messaging and notification components so that they can be lifted into an Rx call chain. o It provides reusable, self-contained, reactive components for common Android use cases and UI concerns. (coming soon). The RxJava Android Module
  • 14. Gradle and Maven Retrolambda Plugin
  • 16. o Observables and Iterables share a similar API. o Observable is the push equivalent of Iterable, which is pull. Iterable and Observable With Iterable, the consumer synchronously pulls values from the producer and the thread is blocked until these values arrive. By contrast, with Observable, the producer asynchronously pushes values to the Observer whenever values are available.
  • 17. The Observer pattern is the perfect fit for any of these scenarios: o When your architecture has two entities, one depending on the other, and you want to keep them separated to change them or reuse them independently. o When a changing object has to notify an unknown amount of related objects about its own o change. o When a changing object has to notify other objects without making assumptions about who these objects are. Observer pattern
  • 20. Subject A subject is a object that can be an Observable and an Observer at the same time. A subject can subscribe to an Observable, acting like an Observer, and it can emit new items or even pass through the item it received, acting like an Observable. RxJava provides four different types of subjects: o PublishSubject - emits all subsequently observed items to the subscriber, once an Observer has subscribed. o BehaviorSubject - emits the most recent item it has observed and all subsequent observed items to each subscribed Observer. o ReplaySubject - buffers all items it observes and replays them to any Observer that subscribes. o AsyncSubject - publishes only the last item observed to each Observer that has subscribed, when the source Observable completes.
  • 23. Observable creation: examples o Observable.just("one", "two", "three"); o Observable.just("one", "two", "three").repeat(3); o Observable.range(10, 3); - Takes two numbers as parameters: the first one is the starting point, and the second one is the amount of numbers we want to emit. o Observable.interval(3, TimeUnit.SECONDS); - Takes two parameters: a number that specifies the amount of time between two emissions, and the unit of time to be used. o Observable.timer(3, 3, TimeUnit.SECONDS); - Starts with an initial delay (3 seconds in the example) and then keeps on emitting a new number every N seconds (3 in the example).
  • 30. Filtering Observables Observable.just("one", "two", "three").filter((s)->{ return !s.equals("two"); });
  • 32. sample() creates a new Observable sequence that will emit the most recent item emitted by the Observable source in a decided time interval. Filtering Observables debounce() starts its internal timer, and if no new item is emitted during this timespan, the last item is emitted by the new Observable.
  • 39. Questions? Thank you for your attention