åºæ¬çã«ã¯ã以åæ¸ãããã®ã«MVPã®æ§æãå½ã¦ã¯ããã ãã§ãã http://qiita.com/MuuKojima/items/8088b43876dc8d3d1745 ä»åã®å 容ã¨ãã¦ã¯USDããJPYã«å¤æããçºæ¿ã¬ã¼ããåãåãTextViewã«è¡¨ç¤ºããã ãã§ãã 使ãAPI: http://fixer.io/ ãªããªã便å©ããã§ããã å®éã®ãªã¯ã¨ã¹ãã§ããhttp://api.fixer.io/latest?base=USD&symbols=JPY ä¸è¨ã®ããã«1件JPYã®ã¬ã¼ããå ¥ã£ã¦ãã¾ãã
ãã®è¨äºã¯RxJava Advent Calendar 2015 11æ¥ç®ã®è¨äºã§ãã RxJavaã»RxAndroidã®ç´¹ä»è¨äºã®ä¸ã«ã¯ãããé¢åãããASyncTaskã使ããªãã¦æ¸ããã¨ãã£ãRxJavaãéåæå¦çã®ä»£ããã¨ãã¦ç´¹ä»ããã¦ãã¾ãã ãã¡ãããéåæå¦çãç½®ãæããããã¨ããç¹ã¯RxJavaã®æå¹çãªä½¿ãæ¹ã®ä¸ã¤ã§ãããRxJavaã«ã¯ä»ã«ã便å©ã«ä½¿ããæ©è½ãããã¾ãã ä»åã¯ãããã®æ©è½ã®ä¸ã¤ã§ããSubjectã«ã¤ãã¦ç´¹ä»ãããã¨æãã¾ãã Subjectã¨ã¯ çãè¨ãã¨ãSubscriberã¨Observableã®2ã¤ã®æ©è½ãä½µãæã£ããã®ãã§ãã Subscriberã«ãããããªonNextãonErrorãonCompleteã¨ãã£ãã¡ã½ãããå¼ã³åºããObservableã®ããã«subscribeã¡ã½ãããå¼ã³åºããã¨ãã§ãã¾ãã Observable.c
Retrofit + RxJava (+RxAndroid) ã§ä»¥ä¸ã®ãããªã¡ãã£ã¨è¤éãªã¦ã¼ã¹ã±ã¼ã¹ã¯ã©ãæ¸ãã°ããã®ããªã¨èª¿ã¹ã¦ã¿ãã defer 㨠onErrorResumeNext ã使ãã°ããããããªãããã¨ãã話 (ãã ãRetrofitã¯é¢ä¿ãªã話ã«ãªã£ã)ã åè: retrofit with rxjava handling network exceptions globally ã¦ã¼ã¹ã±ã¼ã¹ ã¦ã¼ã¶æ å ±ãåå¾ããAPIãå©ãï¼èªè¨¼ãå¿ è¦ãªAPIï¼ 401ãè¿ã£ã¦ããããã¢ã¯ã»ã¹ãã¼ã¯ã³ãå度åå¾ããå¦çãè¡ã ã¢ã¯ã»ã¹ãã¼ã¯ã³ã®ååå¾ã«æåããå ´åã¯ãæ°ããã¢ã¯ã»ã¹ãã¼ã¯ã³ã使ã£ã¦ããã¨ã®ãªã¯ã¨ã¹ãï¼ã¦ã¼ã¶æ å ±ã®åå¾ï¼ããã1åè¡ã ã¢ã¯ã»ã¹ãã¼ã¯ã³ã®ååå¾ã«å¤±æããå ´åã¯ããã°ã¤ã³ç»é¢ã«é£ã°ã å®è£ private void getUser() { Observabl
ä¾ãã°â¯ç§éæä½ããªãã£ãããã¹ãã¼ããã¯ç»é¢ã表示ãããã¨ãããããã®ãæ®éã«ä½ãã¨ã¿ã¤ãã¼ã使ã£ã¦é¢åãªæãã«ãªã£ã¡ããã¾ãããRxJava 㨠RxAndroid ã使ãã¨ã¨ã¦ãç°¡åã«ã§ãã¾ãã RxJava + RxAnroid ã®å ´å ä¾ãã°ãç»é¢ã« EditBox 㨠Button ããã£ã¦ããæååã®å ¥åãã¨ããã¿ã³ãæ¼ããããããç£è¦ãâ¯ç§éæä½ããªãã£ããÃÃãããã¨ããå¦çããããæãRxJava+RxAndroid ã§ã¯ä»¥ä¸ã®ããã«æ¸ãã¾ãã public class MyActivity extends Activity { private static final String TAG = "MyActivity"; private Subscription _subscription; @Override protected void onCreate(Bund
http://weather.livedoor.com/forecast/webservice/json/v1?city=200010 { "pinpointLocations": [ { "link": "http://weather.livedoor.com/area/forecast/2020100", "name": "é·éå¸" }, { "link": "http://weather.livedoor.com/area/forecast/2020700", "name": "é åå¸" }, { "link": "http://weather.livedoor.com/area/forecast/2021100", "name": "ä¸éå¸" }, { "link": "http://weather.livedoor.com/area/forecast/2021200", "nam
dependencies { ext.rx_android_kotlin_version = '0.3.0' ä¸ç¥ compile 'io.reactivex:rxandroid:1.0.1' compile 'io.reactivex:rxjava:1.0.14' compile "com.jakewharton.rxbinding:rxbinding-kotlin:$rx_android_kotlin_version" compile "com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:$rx_android_kotlin_version" compile "com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:$rx_android_kotlin_version" }
RxAndroidãv1.0.0ã«æ´æ°ãã¦ããã¨ãããAppObservableã®é¨åããã¹ã¦ã¨ã©ã¼ã«ãªã£ã¦ãããããã解æ¶ããã¾ã§ã«æ¡å¤æéåã£ã¦ãã¾ã£ãã®ã§ãã®ã¡ã¢ AppObservableã¨ã¯ ActivityãFragmentå é¨ã§Observable#subscribe()ãå¼ãã éããã®ActivityãFragmentãçµäºããã以éã«ãonNextãonCompletedãå¼ã°ãã¦ãã¾ããã¨ãããã¾ãã ãã®çµæãç»é¢ãç ´æ£ãããç¶æ ã§ç»é¢æ´æ°ãè¡ããã¨ãã¦ãã¾ããã¨ã§ã®ã¨ã©ã¼ããObservableãActivityãFragmentã¸ã®å¼·åç §ãæã£ãã¾ã¾ã«ãªã£ã¦ãã¾ããã¨ã«ããã¡ã¢ãªãªã¼ã¯ãçºçãã¦ãã¾ãã¾ãã ãããé²ãããã«onPauseãªã©ã§æ示çã«Subscription#unsubscribe()ãå¼ãã§ãããå¿ è¦ãããã¾ããã ãã®unsubscribeã®
ãã®è¨äºã¯2015å¹´08æ21æ¥ã«æ¸ãããè¨äºã§ãã c88ã§ã¨ã³ã¸ãã¢ç³»ã®æ¬ãè²·ã£ã¦èå³ãæã£ãã®ã§RxAndroidã試ãã¦ã¿ã! RxAndroidã¨ã¯ RxAndroidã¯RxJavaã®Androidç¨ã®æ¡å¼µã¢ã¸ã¥ã¼ã«ã§ãã RxJavaã¯ä¸»ã«éåæå¦çãè¡ããã¨ãåºæ¥ãã©ã¤ãã©ãªã§ãã ã¾ãObserverãã¿ã¼ã³ã«è¸è¥²ãã¦ããããããµã¼ããã¼ãã£ã¼ã®ã©ã¤ãã©ãªã¨ã®é£æºãå¯è½ã§ãã ECMA6ããJavascriptã«æ¨æºæè¼ãããäºå®ã®Promiseã¿ãããªãã®ã§ãã ããã§ã¯Promise.whenã¿ãããªãã¨ããããã¨ãã¦ã¾ãã jQueryã使ãã¨ãããªæãã§ããjavascriptã¯ç°¡åã§ãã var baseUrl = "http://api.openweathermap.org/data/2.5/weather?q="; $.when( $.getJSON(base
https://github.com/gfx/RxT4A ããã¯ä½ RxAndroidã®ãã©ã¼ã¯ RxBindingã®æ©è½ã¯å®è£ ããªã åæ© RxAndroidã®å è¡ããä¸éæ 社å ã§ä½ã£ã¦ãRxJavaç¨ã¦ã¼ãã£ãªãã£ãå ¬éãããï¼æªçæï¼ RxJavaã®ãã¹ããã©ã¯ãã£ã¹ãããããã©ã¯ãã£ã¹ã example/ ã«æä¾ãããï¼æªçæï¼ æä¾ãã¦ãããã® AndroidSchedulers - main threadã§å®è¡ããã¹ã±ã¸ã¥ã¼ã© AndroidCompositeSubscription - CompositeSubscription ãAndroidã³ã³ãã¼ãã³ãã§ä½¿ãããããããã® OperatorAddToCompositeSubscription - method chainä¸ã« AndroidCompositeSubscription#add() ãããããã®ãªãã¬ã¼ã¿
â»ãããã大åå¤ãã®ã§ Androidã§Java8ç°å¢ 2016 - visible true ã御覧ãã ããã ã¯ããã« RxAndroid(ã¨ãããRxJava)ã¨Retrolambdaã§ãããã大ä½Java8ãªç°å¢ã§Androidã¢ããªã±ã¼ã·ã§ã³ãéçºåºæ¥ãã®ã§ã¯ãªããã¨èãã¦è©¦ãã¦ã¿ãã 2014å¹´4æé ã®Retrolambdaã¯ã¾ã 1.1.4ã¨ãã§lambdaããã¾ãç¨åº¦ã«ä½¿ããç¨åº¦ã§ããã¼æ¯ãã£ã¦æããã¯ãã¯ããã¨ããäºã§ã¹ã«ã¼ãã¦ãããã ãã©ãæè¿ä¹ ãã¶ãã«è¦ããã1.8.0ã¾ã§è²ã£ã¦ãã¦Try-with-resources*1ãMethod referencesããµãã¼ãããã¦ããã ã¾ããRxJavaã¯1.0.0ã11æã«ãªãªã¼ã¹ããã¦å®ç¨æ®µéã«å ¥ã£ã¦ãã¦ãããJava8ã®Stream APIãæ¦ãè£å®ããæ§ãªæ©è½ãæã£ã¦ããã æ´ã«Androidã§RxJavaãæ±ããã
ä¾ãã°ã·ã§ããã³ã°ãµã¤ãã¨ãã®çºéå æå®ã®ãã©ã¼ã ãç»é²ããã¦ããä½æã¨ã¯éãä½æã«éãããæããå¥ã®ä½æã«éããããã§ãã¯ãããããã¨ãä½æ2ããå¿ é å ¥åã¨ãªããå ¥åããã¾ã§æ¬¡ã¸é²ããªããçãªã¡ãã£ã¨è¾¼ã¿å ¥ã£ãValidationãReactive Extensionsã®JavaçãRxJavaã¨RxAndroidã§ãã£ã¦ã¿ã¾ããã åä½ã¤ã¡ã¼ã¸ ã¾ããããªãåä½çµæããã ä½æ1ã¯å ¥åå¿ é ã ä½æ2ã¯ãä½æ2ã¸é éãããããã§ãã¯ããã¦ããå ´åã®ã¿ãå ¥åå¿ é ã å¿ é é ç®ãå ¥åããã¦ããªãå ´åã¯ãã¿ã³ãæ¼ããªã ãããªä»æ§ã§ãã å®è£ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activ
ã¯ããã« @rejuspotaroããã®é¢æ°åè¨èªãå¦ã¶ãã¨ã¯å®åã§ã©ãå½¹ã«ç«ã£ãããè¦ã¦RxJavaã使ã£ã¦ã¿ãããªãã¾ãããã¾ããiOSã®Swiftã¨Androidã®Groovyãè¦ã¦ãRxJavaãAndroidã§ä½¿ããªããGroovyã§ã ãªã¨æãã¾ããã ã¾ããä¸è¨ã®è¨äºã§ã¯ãè¨åããã¦ãã¾ããã§ãããRxAndroidã¨ãããã®ãããããã§ããViewã®ã¯ãªãã¯ã®ã¹ããªã¼ã ããEditTextã®å¤æ´ã®ã¹ããªã¼ã ãçæããã¡ã½ãããç¨æããã¦ããã¿ããã§ãã ä»ã¾ã§ç§ã¯ãRxJavaãã¡ãã£ã¨è©¦ãã¦ã¿ããªãGroovy(ããã¨ãã)ã¨ããRxGroovyã«ã¤ãã¦æ稿ãã¦ãã¾ããããä»åãã£ã¨RxAndroidãRxJavaãGroovyã§ä½¿ã£ã¦ã¿ããã¨æãã¾ãã ãã¿ã³ã¯ãªãã¯åæ°ã表示 ãã¿ã³ã¯ãªãã¯ã®åæ°ãTextViewã«è¡¨ç¤ºãããã¨æãã¾ãã(ãããåãã£ã¦ãã¾ãããRx使
REST å¦çãæ±ããããå®è£ ãã Android ã® REST ã¯ã©ã¤ã¢ã³ãã®ãããã¯ã¼ã¯å¦çã¨éåæå¦çã«ã¤ãã¦ãæè¿æµè¡ã£ã¦ãã OkHTTP 㨠Retrofit 㨠RxAndroid ã®çµã¿åããã使ã£ã¦ã¿ã¾ããããããã¯ãããã次ã®ãããªæ©è½ãæä¾ããã©ã¤ãã©ãªã§ãã OkHTTP HTTP ã¯ã©ã¤ã¢ã³ãç¨ã®ã©ã¤ãã©ãª HTTP2/SPDY ãªã©ã®ãããã³ã«ã«ãå¯¾å¿ HTTP ãããã¼ã®ããªã·ã¼ã«æºæ ãããã¼ã«ã«ãã£ãã·ã¥ã®å®è£ Retrofit REST ã¯ã©ã¤ã¢ã³ãç¨ã®ã©ã¤ãã©ãª ã¢ããã¼ã·ã§ã³ã§ã¡ã½ããããã©ã¡ã¼ã¿ãæå®å¯è½ éä¿¡å¦çã¯æ½è±¡åããã¦ããããèªç±ã«å®è£ å¯è½ RxAndroid RxJava ã® Android ç ãªã¢ã¯ãã£ãããã°ã©ãã³ã°ã Android ã§å®è£ ããããã®ã©ã¤ãã©ãª ã¤ãã³ããã¼ã¹ã§é 延å®è¡ãéåæã³ã¼ã«ããã¯ãªã©ãå®è£ å¯è½ ãªããRe
ã¯ããã« ä»äºã§ä½ã£ã¦ããã¢ããªã§éåæå¦çã®ã³ã¼ã«ããã¯ãå°çããã¦ãã¦åãããã«ãªã£ãã®ã§ ãã®ããããããããªè§£æ±ºããããã®ã¢ã¬ã³ã¬ã模索ãã¦ããã ãããªæã«KeithYokomaãããQiitaã«æµ·å¤è¨äºã®ç¿»è¨³ãå ¬éããã®ãèªãã§ãä¸å¿µçºèµ·ããã¨ããå ·åã§ãã ReactiveExtensions - ã翻訳ãAsyncTask 㨠AsyncTaskLoader ã rx.Observable ã«ç½®ãæãã - RxJava Android Patterns - Qiita EventBusã使ãæ¹æ³ãèããã®ã ãã©ãããã¯LocalBroadcast使ãã¾ã§ããªãã¨ãã«çºåãããã®ããããã ãããªãã¨ããææ³ã§ãã ãããªããã§ãè²ã ã¨è¦ããã¨ã»èãããã¨ãåå¿é²ã¨ãã¦ã¾ã¨ãã¾ããã åèã«ãããµã¤ããã¡ ã ãããããèªãã©ãã°OKã¿ãããªãããªæãã§ãã å ¥é Reacti
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}