SlideShare a Scribd company logo
RxAndroid
Leo Y. Kim (@dalinaum)
Rx
The Reactive Extensions (Rx) is a library for
composing asynchronous and event-based
programs using observable sequences and
LINQ-style query operators.
https://msdn.microsoft.com/en-us/data/gg577609
RxJava
RxJava is a Java VM implementation of
Reactive Extensions: a library for composing
asynchronous and event-based programs by
using observable sequences.
Copyright 2013 Netflix, Inc.
(https://github.com/ReactiveX/RxJava)
RxAndroid
RxAndroid
build.gradle
dependencies {
...
compile 'io.reactivex:rxandroid:0.24.0'
}
Observable and Subscriber
River
Observable
onNext
onNext
onCompleted
onNext
An Observable calls this method whenever the
Observable emits an item. This method takes
as a parameter the item emitted by the
Observable.
onError
An Observable calls this method to indicate that
it has failed to generate the expected data or
has encountered some other error. This stops
the Observable and it will not make further calls
to onNext or onCompleted. The onError
method takes as its parameter an indication of
what caused the error.
onCompleted
An Observable calls this method after it has
called onNext for the final time, if it has not
encountered any errors.
3 methods
Simple Observable
Observable<String> simpleObservable =
Observable.create(new Observable.OnSubscribe<String>() {
@Override
public void call(Subscriber<? super String> subscriber) {
subscriber.onNext("Hello RxAndroid !!");
subscriber.onCompleted();
}
});
Simple(?) Subscriber
simpleObservable
.subscribe(new Subscriber<String>() {
@Override
public void onCompleted() {
Log.d(TAG, "complete!");
}
(cont.)
Subscriber
@Override
public void onError(Throwable e) {
Log.e(TAG, "error: " + e.getMessage());
}
@Override
public void onNext(String text) {
((TextView) findViewById(R.id.textView)).setText(text);
}
});
Is it simple subsciber?
Not yet...
simpleObservable
.subscribe(new Action1<String>() {
@Override
public void call(String text) {
((TextView) findViewById(R.id.textView)).setText(text);
}
});
More simple subscriber #1
simpleObservable
.subscribe(new Action1<String>() {
...
}, new Action1<Throwable>() {
...
}, new Action0() {
...
});
More simple subscriber #2
simpleObservable
.subscribe(new Action1<String>() {
...
}, new Action1<Throwable>() {
...
});
More simple subscriber #3
Operator: Map
Operator: Map
.map(new Func1<Integer, Integer>() {
@Override
public Integer call(Integer value) {
return value * 10;
}
})
Operator: map
simpleObservable
.map(new Func1<String, String>() {
@Override
public String call(String text) {
return text.toUpperCase();
}
})
.subscribe(new Action1<String>() {
@Override
public void call(String text) {
((TextView) findViewById(R.id.textView)).setText(text);
}
});
Operator: map
simpleObservable
.map(new Func1<String, Integer>() {
@Override
public Integer call(String text) {
return text.length();
}
})
.subscribe(new Action1<Integer>() {
@Override
public void call(Integer length) {
((TextView) findViewById(R.id.textView)).setText("length: " + length);
}
});
More operators
http://reactivex.io/documentation/operators.html
Observer utilities
Observable<String> simpleObservable =
Observable.just("Hello RxAndroid");
see also: Observable.from (for collections)
Lambda
Observable<String> simpleObservable = Observable.just("Hello
Lambda!!");
simpleObservable
.map(text -> text.length())
.subscribe(length ->((TextView)findViewById(R.id.textView))
.setText("length: " + length));
What is that?
Java 8 Lambda
Lambda: stage 1
.map(new Func1<String, Integer>() {
@Override
public Integer call(String text) {
return text.length();
}
})
Lambda: stage 2
.map((String text) -> {
return text.length();
})
Lambda: stage 3
.map((text) -> {
return text.length();
})
Lambda: stage 4
.map(text -> {
return text.length();
})
Lambda: stage 5
.map(text ->
text.length()
)
Wait? Java 8!?!
Java 8 Lambda
Retrolambda
Java 8 Lambda
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:2.5.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
build.gradle
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
…
}
build.gradle
RxAndroid: ViewObservable.clicks
ViewObservable.clicks
ViewObservable
.clicks(findViewById(R.id.button))
.map(event -> new Random().nextInt())
.subscribe(value -> {
TextView textView = (TextView) findViewB yId(R.id.textView);
textView.setText("number: " + value.toString());
}, throwable -> {
Log.e(TAG, "Error: " + throwable.getMessage());
throwable.printStackTrace();
});
Observable<Event>
ViewObservable
.clicks(findViewById(R.id.button))
.map(event -> new Random().nextInt())
.subscribe(value -> {
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText("number: " + value.toString());
}, throwable -> {
Log.e(TAG, "Error: " + throwable.getMessage());
throwable.printStackTrace();
});
Map: Event -> Integer
ViewObservable
.clicks(findViewById(R.id.button))
.map(event -> new Random().nextInt())
.subscribe(value -> {
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText("number: " + value.toString());
}, throwable -> {
Log.e(TAG, "Error: " + throwable.getMessage());
throwable.printStackTrace();
});
Subscriber
ViewObservable
.clicks(findViewById(R.id.button))
.map(event -> new Random().nextInt())
.subscribe(value -> {
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText("number: " + value.toString());
}, throwable -> {
Log.e(TAG, "Error: " + throwable.getMessage());
throwable.printStackTrace();
});
Observable.merge
Merge
Observable.merge
Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton))
.map(event -> "left");
Observable<String> rights = ViewObservable.clicks(findViewById(R.id.
rightButton))
.map(event -> "right");
Observable<String> together = Observable.merge(lefts, rights);
together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text));
together.map(text -> text.toUpperCase())
.subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
2 Observables
Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton))
.map(event -> "left");
Observable<String> rights = ViewObservable.clicks(findViewById(R.id.
rightButton))
.map(event -> "right");
Observable<String> together = Observable.merge(lefts, rights);
together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text));
together.map(text -> text.toUpperCase())
.subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
Observable.merge
Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton))
.map(event -> "left");
Observable<String> rights = ViewObservable.clicks(findViewById(R.id.
rightButton))
.map(event -> "right");
Observable<String> together = Observable.merge(lefts, rights);
together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text));
together.map(text -> text.toUpperCase())
.subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
2 Subscriber
Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton))
.map(event -> "left");
Observable<String> rights = ViewObservable.clicks(findViewById(R.id.
rightButton))
.map(event -> "right");
Observable<String> together = Observable.merge(lefts, rights);
together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text));
together.map(text -> text.toUpperCase())
.subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
Operator: scan
Operator: scan
Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton))
.map(event -> -1);
Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton))
.map(event -> 1);
Observable<Integer> together = Observable.merge(minuses, pluses);
together.scan(0, (sum, number) -> sum + 1)
.subscribe(count ->
((TextView) findViewById(R.id.count)).setText(count.toString()));
together.scan(0, (sum, number) -> sum + number)
.subscribe(number ->
((TextView) findViewById(R.id.number)).setText(number.toString()));
2 Observables (+map)
Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton))
.map(event -> -1);
Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton))
.map(event -> 1);
Observable<Integer> together = Observable.merge(minuses, pluses);
together.scan(0, (sum, number) -> sum + 1)
.subscribe(count ->
((TextView) findViewById(R.id.count)).setText(count.toString()));
together.scan(0, (sum, number) -> sum + number)
.subscribe(number ->
((TextView) findViewById(R.id.number)).setText(number.toString()));
Merge
Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton))
.map(event -> -1);
Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton))
.map(event -> 1);
Observable<Integer> together = Observable.merge(minuses, pluses);
together.scan(0, (sum, number) -> sum + 1)
.subscribe(count ->
((TextView) findViewById(R.id.count)).setText(count.toString()));
together.scan(0, (sum, number) -> sum + number)
.subscribe(number ->
((TextView) findViewById(R.id.number)).setText(number.toString()));
1st scan + subscriber: counter
Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton))
.map(event -> -1);
Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton))
.map(event -> 1);
Observable<Integer> together = Observable.merge(minuses, pluses);
together.scan(0, (sum, number) -> sum + 1)
.subscribe(count ->
((TextView) findViewById(R.id.count)).setText(count.toString()));
together.scan(0, (sum, number) -> sum + number)
.subscribe(number ->
((TextView) findViewById(R.id.number)).setText(number.toString()));
2nd scan + subscriber: sum
Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton))
.map(event -> -1);
Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton))
.map(event -> 1);
Observable<Integer> together = Observable.merge(minuses, pluses);
together.scan(0, (sum, number) -> sum + 1)
.subscribe(count ->
((TextView) findViewById(R.id.count)).setText(count.toString()));
together.scan(0, (sum, number) -> sum + number)
.subscribe(number ->
((TextView) findViewById(R.id.number)).setText(number.toString()));
Scheduler
Scheduler
Observable.from("one", "two", "three", "four", "five")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(/* an Observer */);
Observable runs on “newThread”
Observable.from("one", "two", "three", "four", "five")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(/* an Observer */);
Subscriber runs on “mainThread”
Observable.from("one", "two", "three", "four", "five")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(/* an Observer */);
Notice:
Subscriber doesn’t run on mainThread immediately.
Bound
new Thread(() -> {
final Handler handler = new Handler();
Observable.from("one", "two", "three", "four", "five")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.handlerThread(handler))
.subscribe(/* an Observer */)
}, "custom-thread-1").start();
Bound to this thread
new Thread(() -> {
final Handler handler = new Handler();
Observable.from("one", "two", "three", "four", "five")
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.handlerThread(handler))
.subscribe(/* an Observer */)
}, "custom-thread-1").start();
Varieties of Scheduler (RxJava)
● Schedulers.computation( )
● Schedulers.from(executor)
● Schedulers.immediate( )
● Schedulers.io( )
● Schedulers.newThread( )
● Schedulers.trampoline( )
Varieties of Scheduler (RxAndroid)
● AndroidSchedulers.mainThread()
● AndroidSchedulers.handlerThread(handler)
Use Schedulers without Observable
worker =
Schedulers.newThread().createWorker();
worker.schedule(() -> {
yourWork();
});
Unsubscirbe Subscription
Subscription s = Observable.from("one", "two",
"three", "four", "five").subscribe(/* Observer */)
s.unsubscribe()
Unsubscirbe CompositeSubscription
private void doSomething() {
mCompositeSubscription.add(
s.subscirbe(/* observer*/);
}
@Override
protected void onDestroy() {
super.onDestroy();
mCompositeSubscription.unsubscribe();
}
Unsubscirbe Subscription
@Override
protected void onDestroy() {
super.onDestroy();
s.unsubscribe();
}
Recursive Schedulers
worker = Schedulers.newThread().createWorker();
worker.schedule(() {
yourWork();
worker.schedule(this);
});
// It will stop your worker
worker.unsubscribe();
Retrofit with RxAndroid
Retrofit without RxAndroid
@GET(“/user/{id}”)
void getUser(
@path(“id”) long id,
Callback<User> callback);
Retrofit with RxAndroid
@GET(“/user/{id}”)
Observable<User> getUser(
@path(“id”) long id);
You can combie Retrofit’s Observables
Observable.zip(
service.getUserPhoto(id),
service.getPhotoMetadata(id),
(photo, metadata) -> createPhotoWithData(photo,
metadata))
.subscribe(photoWithData ->
showPhoto(photoWithData));
Battery with RxAndroid
https://github.com/spoqa/battery
Battery with RxAndroid
@RpcObject(uri="http://ip.jsontest.com/")
public class JsonTest {
@Response public String ip;
}
Observable<JsonTest> jsonTestObservable =
Rpc.invokeRx(new AndroidExecutionContext(this), jsonTest);
jsonTestObservable.subscribe(jsonText -> {
Log.d("MAIN", jsonTest.ip);
});
Subject
Subject
A Subject is a sort of bridge or proxy
that is available in some
implementations of ReactiveX that
acts both as an observer and as an
Observable.
PublishSubject
PublishSubject publishSubject<View> =
PublishSubject.create();
view.setOnClickListener(view ->
publishSubject.onNext(view));
Observable<View> observable =
publishSubject.asObservable();
Use ReplaySubject for caching
ReplaySubject<ImageSearchResult> mSubject =
ReplaySubject.create();
mSubject = ReplaySubject.create();
mPageNumber = 1;
mApi.searchImage(
"json", API_KEY, query, ITEM_COUNT, mPageNumber)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(mSubject::onNext);
Q&A
See also
https://github.com/GDG-Korea/HelloRx
https://github.com/hl5pma/RxExample

More Related Content

What's hot

Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
Brainhub
 
Introduction to rx java for android
Introduction to rx java for androidIntroduction to rx java for android
Introduction to rx java for android
Esa Firman
 
Rxjs ppt
Rxjs pptRxjs ppt
An Introduction to RxJava
An Introduction to RxJavaAn Introduction to RxJava
An Introduction to RxJava
Sanjay Acharya
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
Tomáš Kypta
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
Tomáš Kypta
 
Android architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta IndonesiaAndroid architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta Indonesia
Pratama Nur Wijaya
 
Reactive Java (33rd Degree)
Reactive Java (33rd Degree)Reactive Java (33rd Degree)
Reactive Java (33rd Degree)
Tomasz Kowalczewski
 
Reactive programming with RxJava
Reactive programming with RxJavaReactive programming with RxJava
Reactive programming with RxJava
Jobaer Chowdhury
 
Rxjava meetup presentation
Rxjava meetup presentationRxjava meetup presentation
Rxjava meetup presentation
Guillaume Valverde
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streams
mattpodwysocki
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJS
Sandi Barr
 
Rx java in action
Rx java in actionRx java in action
Rx java in action
Pratama Nur Wijaya
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on Android
Fernando Cejas
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
Rick Warren
 
My Gentle Introduction to RxJS
My Gentle Introduction to RxJSMy Gentle Introduction to RxJS
My Gentle Introduction to RxJS
Mattia Occhiuto
 
RxJava 2.0 介紹
RxJava 2.0 介紹RxJava 2.0 介紹
RxJava 2.0 介紹
Kros Huang
 
Javantura v2 - Making Java web-apps Groovy - Franjo Žilić
Javantura v2 - Making Java web-apps Groovy - Franjo ŽilićJavantura v2 - Making Java web-apps Groovy - Franjo Žilić
Javantura v2 - Making Java web-apps Groovy - Franjo Žilić
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good Parts
Konrad Malawski
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016
Frank Lyaruu
 

What's hot (20)

Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
Introduction to rx java for android
Introduction to rx java for androidIntroduction to rx java for android
Introduction to rx java for android
 
Rxjs ppt
Rxjs pptRxjs ppt
Rxjs ppt
 
An Introduction to RxJava
An Introduction to RxJavaAn Introduction to RxJava
An Introduction to RxJava
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
 
Android architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta IndonesiaAndroid architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta Indonesia
 
Reactive Java (33rd Degree)
Reactive Java (33rd Degree)Reactive Java (33rd Degree)
Reactive Java (33rd Degree)
 
Reactive programming with RxJava
Reactive programming with RxJavaReactive programming with RxJava
Reactive programming with RxJava
 
Rxjava meetup presentation
Rxjava meetup presentationRxjava meetup presentation
Rxjava meetup presentation
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streams
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJS
 
Rx java in action
Rx java in actionRx java in action
Rx java in action
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on Android
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
 
My Gentle Introduction to RxJS
My Gentle Introduction to RxJSMy Gentle Introduction to RxJS
My Gentle Introduction to RxJS
 
RxJava 2.0 介紹
RxJava 2.0 介紹RxJava 2.0 介紹
RxJava 2.0 介紹
 
Javantura v2 - Making Java web-apps Groovy - Franjo Žilić
Javantura v2 - Making Java web-apps Groovy - Franjo ŽilićJavantura v2 - Making Java web-apps Groovy - Franjo Žilić
Javantura v2 - Making Java web-apps Groovy - Franjo Žilić
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good Parts
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016
 

Viewers also liked

RxJava - introduction & design
RxJava - introduction & designRxJava - introduction & design
RxJava - introduction & design
allegro.tech
 
GKAC 2015 Apr. - Xamarin forms, mvvm and testing
GKAC 2015 Apr. - Xamarin forms, mvvm and testingGKAC 2015 Apr. - Xamarin forms, mvvm and testing
GKAC 2015 Apr. - Xamarin forms, mvvm and testing
GDG Korea
 
RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16
Stacy Devino
 
GKAC 2015 Apr. - Android Looper
GKAC 2015 Apr. - Android LooperGKAC 2015 Apr. - Android Looper
GKAC 2015 Apr. - Android Looper
GDG Korea
 
Java Micro Edition Platform & Android - Seminar on Small and Mobile Devices
Java Micro Edition Platform & Android - Seminar on Small and Mobile DevicesJava Micro Edition Platform & Android - Seminar on Small and Mobile Devices
Java Micro Edition Platform & Android - Seminar on Small and Mobile Devices
juricde
 
Intro to Android : Making your first App!
Intro to Android : Making your first App!Intro to Android : Making your first App!
Intro to Android : Making your first App!
Stacy Devino
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!
Stacy Devino
 
GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출
GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출
GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출
GDG Korea
 
같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법
같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법
같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법
GDG Korea
 
디자이너 없어도 괜찮아! (feat.Material Design Guide)
디자이너 없어도 괜찮아! (feat.Material Design Guide)디자이너 없어도 괜찮아! (feat.Material Design Guide)
디자이너 없어도 괜찮아! (feat.Material Design Guide)
GDG Korea
 
GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?
GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?
GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?
GDG Korea
 
GKAC 2014 Nov. - RxJava를 활용한 Functional Reactive Programming
GKAC 2014 Nov. - RxJava를 활용한 Functional Reactive ProgrammingGKAC 2014 Nov. - RxJava를 활용한 Functional Reactive Programming
GKAC 2014 Nov. - RxJava를 활용한 Functional Reactive Programming
GDG Korea
 
track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민
track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민 track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민
track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민
양 한빛
 
GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지
GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지
GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지
GDG Korea
 
Best Practices in Media Playback
Best Practices in Media PlaybackBest Practices in Media Playback
Best Practices in Media Playback
GDG Korea
 
FIrebase를 이용한 호우호우 미니게임 만들기
FIrebase를 이용한 호우호우 미니게임 만들기FIrebase를 이용한 호우호우 미니게임 만들기
FIrebase를 이용한 호우호우 미니게임 만들기
GDG Korea
 
Reinfocement learning
Reinfocement learningReinfocement learning
Reinfocement learning
GDG Korea
 
안드로이드 데이터 바인딩
안드로이드 데이터 바인딩안드로이드 데이터 바인딩
안드로이드 데이터 바인딩
GDG Korea
 
Introduce Android TV and new features from Google I/O 2016
Introduce Android TV and new features from Google I/O 2016Introduce Android TV and new features from Google I/O 2016
Introduce Android TV and new features from Google I/O 2016
GDG Korea
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
Tomáš Kypta
 

Viewers also liked (20)

RxJava - introduction & design
RxJava - introduction & designRxJava - introduction & design
RxJava - introduction & design
 
GKAC 2015 Apr. - Xamarin forms, mvvm and testing
GKAC 2015 Apr. - Xamarin forms, mvvm and testingGKAC 2015 Apr. - Xamarin forms, mvvm and testing
GKAC 2015 Apr. - Xamarin forms, mvvm and testing
 
RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16
 
GKAC 2015 Apr. - Android Looper
GKAC 2015 Apr. - Android LooperGKAC 2015 Apr. - Android Looper
GKAC 2015 Apr. - Android Looper
 
Java Micro Edition Platform & Android - Seminar on Small and Mobile Devices
Java Micro Edition Platform & Android - Seminar on Small and Mobile DevicesJava Micro Edition Platform & Android - Seminar on Small and Mobile Devices
Java Micro Edition Platform & Android - Seminar on Small and Mobile Devices
 
Intro to Android : Making your first App!
Intro to Android : Making your first App!Intro to Android : Making your first App!
Intro to Android : Making your first App!
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!
 
GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출
GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출
GKAC 2015 Apr. - Battery, 안드로이드를 위한 쉬운 웹 API 호출
 
같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법
같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법
같은 유저수, 다른 수익? 모바일 앱의 수익을 높이는 방법
 
디자이너 없어도 괜찮아! (feat.Material Design Guide)
디자이너 없어도 괜찮아! (feat.Material Design Guide)디자이너 없어도 괜찮아! (feat.Material Design Guide)
디자이너 없어도 괜찮아! (feat.Material Design Guide)
 
GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?
GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?
GKAC 2014 Nov. - Android Wear 개발, 할까요 말까요?
 
GKAC 2014 Nov. - RxJava를 활용한 Functional Reactive Programming
GKAC 2014 Nov. - RxJava를 활용한 Functional Reactive ProgrammingGKAC 2014 Nov. - RxJava를 활용한 Functional Reactive Programming
GKAC 2014 Nov. - RxJava를 활용한 Functional Reactive Programming
 
track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민
track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민 track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민
track2 04. MS는 Rx를 왜 만들었을까? feat. RxJS/ 네이버, 김훈민
 
GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지
GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지
GKAC 2015 Apr. - 테스트 코드에서 코드 커버리지까지
 
Best Practices in Media Playback
Best Practices in Media PlaybackBest Practices in Media Playback
Best Practices in Media Playback
 
FIrebase를 이용한 호우호우 미니게임 만들기
FIrebase를 이용한 호우호우 미니게임 만들기FIrebase를 이용한 호우호우 미니게임 만들기
FIrebase를 이용한 호우호우 미니게임 만들기
 
Reinfocement learning
Reinfocement learningReinfocement learning
Reinfocement learning
 
안드로이드 데이터 바인딩
안드로이드 데이터 바인딩안드로이드 데이터 바인딩
안드로이드 데이터 바인딩
 
Introduce Android TV and new features from Google I/O 2016
Introduce Android TV and new features from Google I/O 2016Introduce Android TV and new features from Google I/O 2016
Introduce Android TV and new features from Google I/O 2016
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
 

Similar to GKAC 2015 Apr. - RxAndroid

Tech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn Tới
Tech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn TớiTech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn Tới
Tech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn Tới
Nexus FrontierTech
 
Rxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaRxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJava
Kros Huang
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
Florent Pillet
 
"Kotlin и rx в android" Дмитрий Воронин (Avito)
"Kotlin и rx в android" Дмитрий Воронин  (Avito)"Kotlin и rx в android" Дмитрий Воронин  (Avito)
"Kotlin и rx в android" Дмитрий Воронин (Avito)
AvitoTech
 
Android crashcourse
Android crashcourseAndroid crashcourse
Android crashcourse
Alexey Buzdin
 
From zero to hero with the reactive extensions for java script
From zero to hero with the reactive extensions for java scriptFrom zero to hero with the reactive extensions for java script
From zero to hero with the reactive extensions for java script
Maurice De Beijer [MVP]
 
Rx workshop
Rx workshopRx workshop
Rx workshop
Ryan Riley
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Codemotion
 
JS Experience 2017 - Reactive Interfaces com React & RxJS
JS Experience 2017 - Reactive Interfaces com React & RxJSJS Experience 2017 - Reactive Interfaces com React & RxJS
JS Experience 2017 - Reactive Interfaces com React & RxJS
iMasters
 
Rx – reactive extensions
Rx – reactive extensionsRx – reactive extensions
Rx – reactive extensions
Voislav Mishevski
 
From zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScriptFrom zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
RxJava2 Slides
RxJava2 SlidesRxJava2 Slides
RxJava2 Slides
YarikS
 
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
GreeceJS
 
Cycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI frameworkCycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI framework
Nikos Kalogridis
 
Reactive programming and RxJS
Reactive programming and RxJSReactive programming and RxJS
Reactive programming and RxJS
Ravi Mone
 
Rxjs marble-testing
Rxjs marble-testingRxjs marble-testing
Rxjs marble-testing
Christoffer Noring
 
Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014
hezamu
 
RxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камниRxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камни
Stfalcon Meetups
 
RxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScriptRxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScript
Viliam Elischer
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
Macoscope
 

Similar to GKAC 2015 Apr. - RxAndroid (20)

Tech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn Tới
Tech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn TớiTech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn Tới
Tech Talk #4 : RxJava and Using RxJava in MVP - Dương Văn Tới
 
Rxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaRxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJava
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 
"Kotlin и rx в android" Дмитрий Воронин (Avito)
"Kotlin и rx в android" Дмитрий Воронин  (Avito)"Kotlin и rx в android" Дмитрий Воронин  (Avito)
"Kotlin и rx в android" Дмитрий Воронин (Avito)
 
Android crashcourse
Android crashcourseAndroid crashcourse
Android crashcourse
 
From zero to hero with the reactive extensions for java script
From zero to hero with the reactive extensions for java scriptFrom zero to hero with the reactive extensions for java script
From zero to hero with the reactive extensions for java script
 
Rx workshop
Rx workshopRx workshop
Rx workshop
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
 
JS Experience 2017 - Reactive Interfaces com React & RxJS
JS Experience 2017 - Reactive Interfaces com React & RxJSJS Experience 2017 - Reactive Interfaces com React & RxJS
JS Experience 2017 - Reactive Interfaces com React & RxJS
 
Rx – reactive extensions
Rx – reactive extensionsRx – reactive extensions
Rx – reactive extensions
 
From zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScriptFrom zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScript
 
RxJava2 Slides
RxJava2 SlidesRxJava2 Slides
RxJava2 Slides
 
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
 
Cycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI frameworkCycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI framework
 
Reactive programming and RxJS
Reactive programming and RxJSReactive programming and RxJS
Reactive programming and RxJS
 
Rxjs marble-testing
Rxjs marble-testingRxjs marble-testing
Rxjs marble-testing
 
Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014
 
RxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камниRxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камни
 
RxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScriptRxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScript
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 

More from GDG Korea

접근성(Accessibility)과 안드로이드
접근성(Accessibility)과 안드로이드접근성(Accessibility)과 안드로이드
접근성(Accessibility)과 안드로이드
GDG Korea
 
Tensorflow 101
Tensorflow 101Tensorflow 101
Tensorflow 101
GDG Korea
 
Building Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase AnalyticsBuilding Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase Analytics
GDG Korea
 
GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기
GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기
GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기
GDG Korea
 
GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기
GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기
GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기
GDG Korea
 
GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기
GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기
GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기
GDG Korea
 
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GDG Korea
 

More from GDG Korea (7)

접근성(Accessibility)과 안드로이드
접근성(Accessibility)과 안드로이드접근성(Accessibility)과 안드로이드
접근성(Accessibility)과 안드로이드
 
Tensorflow 101
Tensorflow 101Tensorflow 101
Tensorflow 101
 
Building Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase AnalyticsBuilding Extraordinary Apps with Firebase Analytics
Building Extraordinary Apps with Firebase Analytics
 
GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기
GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기
GKAC 2014 Nov. - 안드로이드 스튜디오로 생산성 올리기
 
GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기
GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기
GKAC 2014 Nov. - 그루비로 안드로이드 앱 개발하기
 
GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기
GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기
GKAC 2014 Nov. - The Beautiful Design Collection 살펴보기
 
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
GKAC 2014 Nov. - 안드로이드 5.0의 새로운 기능
 

Recently uploaded

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Semiosis Software Private Limited
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 

Recently uploaded (20)

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 

GKAC 2015 Apr. - RxAndroid

  • 1. RxAndroid Leo Y. Kim (@dalinaum)
  • 2. Rx The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. https://msdn.microsoft.com/en-us/data/gg577609
  • 3. RxJava RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences. Copyright 2013 Netflix, Inc. (https://github.com/ReactiveX/RxJava)
  • 8. onNext An Observable calls this method whenever the Observable emits an item. This method takes as a parameter the item emitted by the Observable.
  • 9. onError An Observable calls this method to indicate that it has failed to generate the expected data or has encountered some other error. This stops the Observable and it will not make further calls to onNext or onCompleted. The onError method takes as its parameter an indication of what caused the error.
  • 10. onCompleted An Observable calls this method after it has called onNext for the final time, if it has not encountered any errors.
  • 12. Simple Observable Observable<String> simpleObservable = Observable.create(new Observable.OnSubscribe<String>() { @Override public void call(Subscriber<? super String> subscriber) { subscriber.onNext("Hello RxAndroid !!"); subscriber.onCompleted(); } });
  • 13. Simple(?) Subscriber simpleObservable .subscribe(new Subscriber<String>() { @Override public void onCompleted() { Log.d(TAG, "complete!"); } (cont.)
  • 14. Subscriber @Override public void onError(Throwable e) { Log.e(TAG, "error: " + e.getMessage()); } @Override public void onNext(String text) { ((TextView) findViewById(R.id.textView)).setText(text); } });
  • 15. Is it simple subsciber? Not yet...
  • 16. simpleObservable .subscribe(new Action1<String>() { @Override public void call(String text) { ((TextView) findViewById(R.id.textView)).setText(text); } }); More simple subscriber #1
  • 17. simpleObservable .subscribe(new Action1<String>() { ... }, new Action1<Throwable>() { ... }, new Action0() { ... }); More simple subscriber #2
  • 18. simpleObservable .subscribe(new Action1<String>() { ... }, new Action1<Throwable>() { ... }); More simple subscriber #3
  • 20. Operator: Map .map(new Func1<Integer, Integer>() { @Override public Integer call(Integer value) { return value * 10; } })
  • 21. Operator: map simpleObservable .map(new Func1<String, String>() { @Override public String call(String text) { return text.toUpperCase(); } }) .subscribe(new Action1<String>() { @Override public void call(String text) { ((TextView) findViewById(R.id.textView)).setText(text); } });
  • 22. Operator: map simpleObservable .map(new Func1<String, Integer>() { @Override public Integer call(String text) { return text.length(); } }) .subscribe(new Action1<Integer>() { @Override public void call(Integer length) { ((TextView) findViewById(R.id.textView)).setText("length: " + length); } });
  • 24. Observer utilities Observable<String> simpleObservable = Observable.just("Hello RxAndroid"); see also: Observable.from (for collections)
  • 25. Lambda Observable<String> simpleObservable = Observable.just("Hello Lambda!!"); simpleObservable .map(text -> text.length()) .subscribe(length ->((TextView)findViewById(R.id.textView)) .setText("length: " + length));
  • 26. What is that? Java 8 Lambda
  • 27. Lambda: stage 1 .map(new Func1<String, Integer>() { @Override public Integer call(String text) { return text.length(); } })
  • 28. Lambda: stage 2 .map((String text) -> { return text.length(); })
  • 29. Lambda: stage 3 .map((text) -> { return text.length(); })
  • 30. Lambda: stage 4 .map(text -> { return text.length(); })
  • 31. Lambda: stage 5 .map(text -> text.length() )
  • 32.
  • 35. buildscript { repositories { jcenter() } dependencies { classpath 'me.tatarka:gradle-retrolambda:2.5.0' } } apply plugin: 'com.android.application' apply plugin: 'me.tatarka.retrolambda' build.gradle
  • 36. android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } … } build.gradle
  • 38. ViewObservable.clicks ViewObservable .clicks(findViewById(R.id.button)) .map(event -> new Random().nextInt()) .subscribe(value -> { TextView textView = (TextView) findViewB yId(R.id.textView); textView.setText("number: " + value.toString()); }, throwable -> { Log.e(TAG, "Error: " + throwable.getMessage()); throwable.printStackTrace(); });
  • 39. Observable<Event> ViewObservable .clicks(findViewById(R.id.button)) .map(event -> new Random().nextInt()) .subscribe(value -> { TextView textView = (TextView) findViewById(R.id.textView); textView.setText("number: " + value.toString()); }, throwable -> { Log.e(TAG, "Error: " + throwable.getMessage()); throwable.printStackTrace(); });
  • 40. Map: Event -> Integer ViewObservable .clicks(findViewById(R.id.button)) .map(event -> new Random().nextInt()) .subscribe(value -> { TextView textView = (TextView) findViewById(R.id.textView); textView.setText("number: " + value.toString()); }, throwable -> { Log.e(TAG, "Error: " + throwable.getMessage()); throwable.printStackTrace(); });
  • 41. Subscriber ViewObservable .clicks(findViewById(R.id.button)) .map(event -> new Random().nextInt()) .subscribe(value -> { TextView textView = (TextView) findViewById(R.id.textView); textView.setText("number: " + value.toString()); }, throwable -> { Log.e(TAG, "Error: " + throwable.getMessage()); throwable.printStackTrace(); });
  • 43. Merge
  • 44. Observable.merge Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton)) .map(event -> "left"); Observable<String> rights = ViewObservable.clicks(findViewById(R.id. rightButton)) .map(event -> "right"); Observable<String> together = Observable.merge(lefts, rights); together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text)); together.map(text -> text.toUpperCase()) .subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
  • 45. 2 Observables Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton)) .map(event -> "left"); Observable<String> rights = ViewObservable.clicks(findViewById(R.id. rightButton)) .map(event -> "right"); Observable<String> together = Observable.merge(lefts, rights); together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text)); together.map(text -> text.toUpperCase()) .subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
  • 46. Observable.merge Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton)) .map(event -> "left"); Observable<String> rights = ViewObservable.clicks(findViewById(R.id. rightButton)) .map(event -> "right"); Observable<String> together = Observable.merge(lefts, rights); together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text)); together.map(text -> text.toUpperCase()) .subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
  • 47. 2 Subscriber Observable<String> lefts = ViewObservable.clicks(findViewById(R.id.leftButton)) .map(event -> "left"); Observable<String> rights = ViewObservable.clicks(findViewById(R.id. rightButton)) .map(event -> "right"); Observable<String> together = Observable.merge(lefts, rights); together.subscribe(text -> ((TextView) findViewById(R.id.textView)).setText(text)); together.map(text -> text.toUpperCase()) .subscribe(text -> Toast.makeText(this, text, Toast.LENGTH_SHORT).show());
  • 49.
  • 50. Operator: scan Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton)) .map(event -> -1); Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton)) .map(event -> 1); Observable<Integer> together = Observable.merge(minuses, pluses); together.scan(0, (sum, number) -> sum + 1) .subscribe(count -> ((TextView) findViewById(R.id.count)).setText(count.toString())); together.scan(0, (sum, number) -> sum + number) .subscribe(number -> ((TextView) findViewById(R.id.number)).setText(number.toString()));
  • 51. 2 Observables (+map) Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton)) .map(event -> -1); Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton)) .map(event -> 1); Observable<Integer> together = Observable.merge(minuses, pluses); together.scan(0, (sum, number) -> sum + 1) .subscribe(count -> ((TextView) findViewById(R.id.count)).setText(count.toString())); together.scan(0, (sum, number) -> sum + number) .subscribe(number -> ((TextView) findViewById(R.id.number)).setText(number.toString()));
  • 52. Merge Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton)) .map(event -> -1); Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton)) .map(event -> 1); Observable<Integer> together = Observable.merge(minuses, pluses); together.scan(0, (sum, number) -> sum + 1) .subscribe(count -> ((TextView) findViewById(R.id.count)).setText(count.toString())); together.scan(0, (sum, number) -> sum + number) .subscribe(number -> ((TextView) findViewById(R.id.number)).setText(number.toString()));
  • 53. 1st scan + subscriber: counter Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton)) .map(event -> -1); Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton)) .map(event -> 1); Observable<Integer> together = Observable.merge(minuses, pluses); together.scan(0, (sum, number) -> sum + 1) .subscribe(count -> ((TextView) findViewById(R.id.count)).setText(count.toString())); together.scan(0, (sum, number) -> sum + number) .subscribe(number -> ((TextView) findViewById(R.id.number)).setText(number.toString()));
  • 54. 2nd scan + subscriber: sum Observable<Integer> minuses = ViewObservable.clicks(findViewById(R.id.minusButton)) .map(event -> -1); Observable<Integer> pluses = ViewObservable.clicks(findViewById(R.id.plusButton)) .map(event -> 1); Observable<Integer> together = Observable.merge(minuses, pluses); together.scan(0, (sum, number) -> sum + 1) .subscribe(count -> ((TextView) findViewById(R.id.count)).setText(count.toString())); together.scan(0, (sum, number) -> sum + number) .subscribe(number -> ((TextView) findViewById(R.id.number)).setText(number.toString()));
  • 56. Scheduler Observable.from("one", "two", "three", "four", "five") .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(/* an Observer */);
  • 57. Observable runs on “newThread” Observable.from("one", "two", "three", "four", "five") .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(/* an Observer */);
  • 58. Subscriber runs on “mainThread” Observable.from("one", "two", "three", "four", "five") .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(/* an Observer */); Notice: Subscriber doesn’t run on mainThread immediately.
  • 59. Bound new Thread(() -> { final Handler handler = new Handler(); Observable.from("one", "two", "three", "four", "five") .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.handlerThread(handler)) .subscribe(/* an Observer */) }, "custom-thread-1").start();
  • 60. Bound to this thread new Thread(() -> { final Handler handler = new Handler(); Observable.from("one", "two", "three", "four", "five") .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.handlerThread(handler)) .subscribe(/* an Observer */) }, "custom-thread-1").start();
  • 61. Varieties of Scheduler (RxJava) ● Schedulers.computation( ) ● Schedulers.from(executor) ● Schedulers.immediate( ) ● Schedulers.io( ) ● Schedulers.newThread( ) ● Schedulers.trampoline( )
  • 62. Varieties of Scheduler (RxAndroid) ● AndroidSchedulers.mainThread() ● AndroidSchedulers.handlerThread(handler)
  • 63. Use Schedulers without Observable worker = Schedulers.newThread().createWorker(); worker.schedule(() -> { yourWork(); });
  • 64. Unsubscirbe Subscription Subscription s = Observable.from("one", "two", "three", "four", "five").subscribe(/* Observer */) s.unsubscribe()
  • 65. Unsubscirbe CompositeSubscription private void doSomething() { mCompositeSubscription.add( s.subscirbe(/* observer*/); } @Override protected void onDestroy() { super.onDestroy(); mCompositeSubscription.unsubscribe(); }
  • 66. Unsubscirbe Subscription @Override protected void onDestroy() { super.onDestroy(); s.unsubscribe(); }
  • 67. Recursive Schedulers worker = Schedulers.newThread().createWorker(); worker.schedule(() { yourWork(); worker.schedule(this); }); // It will stop your worker worker.unsubscribe();
  • 69. Retrofit without RxAndroid @GET(“/user/{id}”) void getUser( @path(“id”) long id, Callback<User> callback);
  • 71. You can combie Retrofit’s Observables Observable.zip( service.getUserPhoto(id), service.getPhotoMetadata(id), (photo, metadata) -> createPhotoWithData(photo, metadata)) .subscribe(photoWithData -> showPhoto(photoWithData));
  • 73. Battery with RxAndroid @RpcObject(uri="http://ip.jsontest.com/") public class JsonTest { @Response public String ip; } Observable<JsonTest> jsonTestObservable = Rpc.invokeRx(new AndroidExecutionContext(this), jsonTest); jsonTestObservable.subscribe(jsonText -> { Log.d("MAIN", jsonTest.ip); });
  • 75. Subject A Subject is a sort of bridge or proxy that is available in some implementations of ReactiveX that acts both as an observer and as an Observable.
  • 76.
  • 77. PublishSubject PublishSubject publishSubject<View> = PublishSubject.create(); view.setOnClickListener(view -> publishSubject.onNext(view)); Observable<View> observable = publishSubject.asObservable();
  • 78.
  • 79.
  • 80.
  • 81. Use ReplaySubject for caching ReplaySubject<ImageSearchResult> mSubject = ReplaySubject.create(); mSubject = ReplaySubject.create(); mPageNumber = 1; mApi.searchImage( "json", API_KEY, query, ITEM_COUNT, mPageNumber) .observeOn(AndroidSchedulers.mainThread()) .subscribe(mSubject::onNext);
  • 82. Q&A