{"id":721,"date":"2022-11-19T19:12:51","date_gmt":"2023-02-24T04:13:28","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/android-rxjava-%e3%81%a8-retrofit\/"},"modified":"2025-08-01T01:56:30","modified_gmt":"2025-07-31T16:56:30","slug":"android-rxjava-%e3%81%a8-retrofit","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/","title":{"rendered":"Android RxJava \u3068 Retrofit"},"content":{"rendered":"<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Android\u30a2\u30d7\u30ea\u3067RxJava\u3092\u4f7f\u7528\u3057\u3066Retrofit\u306e\u547c\u3073\u51fa\u3057\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002Retrofit\u3068RxJava\u3092\u4f7f\u7528\u3057\u3066\u3001RecyclerView\u3092\u57cb\u3081\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002CryptoCurrency API\u3092\u4f7f\u7528\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n<p>\u4f55\u3092\u5b66\u3073\u307e\u3059\u304b\uff1f (Nani o manabimasu ka?)<\/p>\n<ul class=\"post-ul\">\n<li>Making a Retrofit call using RxJava.<\/li>\n<li>Doing Multiple Retrofit Calls Using RxJava<\/li>\n<li>Transforming the Retrofit POJO response using RxJava<\/li>\n<\/ul>\n<p>\u79c1\u305f\u3061\u306fAndroid\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Java 8\u3092\u4f7f\u7528\u3057\u3001\u30e9\u30e0\u30c0\u5f0f\u3092\u6d3b\u7528\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n<h2>\u6982\u8981<\/h2>\n<p>Retrofit\u306f\u3001REST\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u3042\u308a\u3001OkHttp\u3092HttpClient\u3068\u3057\u3066\u4f7f\u7528\u3057\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u89e3\u6790\u306bJSON\u30d1\u30fc\u30b5\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001gson\u3092JSON\u30d1\u30fc\u30b5\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002Retrofit\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u4f5c\u6210\u65b9\u6cd5\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\r\n        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\r\n        OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();\r\n\r\n        Gson gson = new GsonBuilder()\r\n                .setLenient()\r\n                .create();\r\n\r\n        Retrofit retrofit = new Retrofit.Builder()\r\n                .baseUrl(BASE_URL)\r\n                .client(client)\r\n                .addConverterFactory(GsonConverterFactory.create(gson))\r\n                .build();\r\n<\/code><\/pre>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30b3\u30fc\u30eb\u4e2d\u306e\u30c7\u30fc\u30bf\u3092\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u305f\u3081\u306b\u306f\u3001HttpLoggingInterceptor\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002RxJava\u306f\u3001\u30b9\u30c8\u30ea\u30fc\u30e0\u5f62\u5f0f\u306e\u975e\u540c\u671f\u304a\u3088\u3073\u30ea\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u4f7f\u7528\u3055\u308c\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002RxJava\u3067\u306f\u7570\u306a\u308b\u30b9\u30ec\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30b3\u30fc\u30eb\u306b\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30b9\u30ec\u30c3\u30c9\u3092\u3001UI\u306e\u66f4\u65b0\u306b\u306f\u30e1\u30a4\u30f3\u30b9\u30ec\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002RxJava\u3067\u306f\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u304c\u7570\u306a\u308b\u30b9\u30ec\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u64cd\u4f5c\u3092\u5b9f\u884c\u3059\u308b\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u3044\u307e\u3059\u3002RxAndroid\u306fRxJava\u306e\u62e1\u5f35\u3067\u3042\u308a\u3001Android\u74b0\u5883\u3067\u4f7f\u7528\u3059\u308b\u305f\u3081\u306eAndroid\u30b9\u30ec\u30c3\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002Retrofit\u74b0\u5883\u3067RxJava\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u30012\u3064\u306e\u4e3b\u306a\u5909\u66f4\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>Add the RxJava in Retrofit Builder.<\/li>\n<li>Use Observable type in the interface instead of Call<\/li>\n<\/ul>\n<p>\u8907\u6570\u306e\u30b3\u30fc\u30eb\u3092\u5b9f\u884c\u3057\u305f\u308a\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u5909\u63db\u3059\u308b\u305f\u3081\u306b\u306f\u3001RxJava\u306e\u30aa\u30da\u30ec\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u901a\u3057\u3066\u3001\u305d\u306e\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020<\/h3>\n<p>\u79c1\u305f\u3061\u306ebuild.gradle\u30d5\u30a1\u30a4\u30eb\u306b\u6b21\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002 (Watashitachi no build.gradle faini jyunjo kankei o tsuika shitekudasai)<\/p>\n<pre class=\"post-pre\"><code>    implementation 'com.android.support:cardview-v7:27.1.0'\r\n    implementation 'com.android.support:design:27.1.0'\r\n    implementation('com.squareup.retrofit2:retrofit:2.3.0')\r\n            {\r\n                exclude module: 'okhttp'\r\n            }\r\n\r\n    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'\r\n    implementation 'io.reactivex.rxjava2:rxjava:2.1.9'\r\n    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'\r\n    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'\r\n    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'\r\n<\/code><\/pre>\n<h3>\u30b3\u30fc\u30c9<\/h3>\n<p>\u4ee5\u4e0b\u306b\u3001layout activity_main.xml \u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;android.support.constraint.ConstraintLayout xmlns:android=\"https:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"https:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;android.support.v7.widget.RecyclerView\r\n        android:id=\"@+id\/recyclerView\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\" \/&gt;\r\n\r\n&lt;\/android.support.constraint.ConstraintLayout&gt;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306b\u306f\u3001CryptocurrencyService.java\u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.rxjavaretrofit;\r\n\r\nimport com.scdev.rxjavaretrofit.pojo.Crypto;\r\n\r\nimport io.reactivex.Observable;\r\nimport retrofit2.http.GET;\r\nimport retrofit2.http.Path;\r\n\r\npublic interface CryptocurrencyService {\r\n\r\n\r\n    String BASE_URL = \"https:\/\/api.cryptonator.com\/api\/full\/\";\r\n\r\n    @GET(\"{coin}-usd\")\r\n    Observable&lt;Crypto&gt; getCoinData(@Path(\"coin\") String coin);\r\n}\r\n<\/code><\/pre>\n<p>@Path\u306f\u3001\u4e2d\u62ec\u5f27\u306b\u6307\u5b9a\u3057\u305f\u30d1\u30b9\u3092\u6e21\u3057\u307e\u3059\u3002\u6ce8\u610f\uff1a@Path\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u540d\u524d\u306f\u3001@GET\u5185\u306e\u540d\u524d\u3068\u4e00\u81f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u3001POJO\u30af\u30e9\u30b9\u3067\u3042\u308bCrypto.java\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.rxjavaretrofit.pojo;\r\n\r\nimport com.google.gson.annotations.SerializedName;\r\nimport java.util.List;\r\n\r\npublic class Crypto {\r\n\r\n    @SerializedName(\"ticker\")\r\n    public Ticker ticker;\r\n    @SerializedName(\"timestamp\")\r\n    public Integer timestamp;\r\n    @SerializedName(\"success\")\r\n    public Boolean success;\r\n    @SerializedName(\"error\")\r\n    public String error;\r\n\r\n\r\n    public class Market {\r\n\r\n        @SerializedName(\"market\")\r\n        public String market;\r\n        @SerializedName(\"price\")\r\n        public String price;\r\n        @SerializedName(\"volume\")\r\n        public Float volume;\r\n\r\n        public String coinName;\r\n\r\n    }\r\n\r\n    public class Ticker {\r\n\r\n        @SerializedName(\"base\")\r\n        public String base;\r\n        @SerializedName(\"target\")\r\n        public String target;\r\n        @SerializedName(\"price\")\r\n        public String price;\r\n        @SerializedName(\"volume\")\r\n        public String volume;\r\n        @SerializedName(\"change\")\r\n        public String change;\r\n        @SerializedName(\"markets\")\r\n        public List&lt;Market&gt; markets = null;\r\n\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>coinName\u306f\u3001\u79c1\u305f\u3061\u304c\u8a2d\u5b9a\u3057\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u3059\u3002RxJava\u306e\u9b54\u6cd5\u3092\u4f7f\u3063\u3066\u3001\u3053\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<h3>RxJava\u3092\u4f7f\u7528\u3057\u3066\u5358\u4e00\u306e\u30b3\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<pre class=\"post-pre\"><code>CryptocurrencyService cryptocurrencyService = retrofit.create(CryptocurrencyService.class);\r\n        \r\nObservable&lt;Crypto&gt; cryptoObservable = cryptocurrencyService.getCoinData(\"btc\");\r\ncryptoObservable.subscribeOn(Schedulers.io())\r\n.observeOn(AndroidSchedulers.mainThread())\r\n.map(result -&gt; result.ticker)\r\n.subscribe(this::handleResults, this::handleError);\r\n<\/code><\/pre>\n<p>subscribeOn() \u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u547c\u3073\u51fa\u3057\u3092\u884c\u3046\u305f\u3081\u306b\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30b9\u30ec\u30c3\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u306e\u3044\u305a\u308c\u304b\u3092\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>trampoline(): This runs the tasks on the current thread. So it\u2019ll run your code after the current task on the thread is complete. Useful for queueing operations.<\/li>\n<li>newThread(): Creates and returns a Scheduler that creates a new Thread for each unit of work. This is costly since it creates a separate thread everytime.<\/li>\n<li>computation(): Creates and returns a Scheduler intended for computational work. This should be used for parallel work since the thread pool is bound. I\/O operations shouldn\u2019t be done here.<\/li>\n<li>io(): Creates and returns a Scheduler intended for IO-bound work. Again it\u2019s bounded like computation. Typically this is used for network calls.<\/li>\n<\/ul>\n<p>subscribeOn()\u3068observeOn()\u306e\u9055\u3044<\/p>\n<ul class=\"post-ul\">\n<li>subscribeOn works downstream and upstream. All the tasks above and below it would use the same thread.<\/li>\n<li>observeOn works downstream only.<\/li>\n<li>consecutive subscribeOn methods won\u2019t change the thread. Only the first subscribeOn thread would be used.<\/li>\n<li>consecutive observeOn methods will change the thread.<\/li>\n<li>After an observeOn(), putting a subscribeOn() won\u2019t change the thread. Hence observeOn should generally come after a subscribeOn.<\/li>\n<\/ul>\n<p>AndroidSchedulers.mainThread()\u306fRxAndroid\u306e\u4e00\u90e8\u3067\u3042\u308a\u3001\u30c7\u30fc\u30bf\u3092\u30e1\u30a4\u30f3\u30b9\u30ec\u30c3\u30c9\u4e0a\u3067\u306e\u307f\u89b3\u5bdf\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002subscribe\u30e1\u30bd\u30c3\u30c9\u306fretrofit\u306e\u547c\u3073\u51fa\u3057\u3092\u30c8\u30ea\u30ac\u30fc\u3068\u3057\u3001handleResults\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<h3>\u8907\u6570\u306e\u96fb\u8a71<\/h3>\n<p>RxJava\u306emerge\u30aa\u30da\u30ec\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u3001Retrofit\u306e\u547c\u3073\u51fa\u3057\u30922\u3064\u9023\u7d9a\u3057\u3066\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>Observable&lt;List&lt;Crypto.Market&gt;&gt; btcObservable = cryptocurrencyService.getCoinData(\"btc\");\r\n\r\nObservable&lt;List&lt;Crypto.Market&gt;&gt; ethObservable = cryptocurrencyService.getCoinData(\"eth\");\r\n\r\nObservable.merge(btcObservable, ethObservable)\r\n                .subscribeOn(Schedulers.computation())\r\n                .observeOn(AndroidSchedulers.mainThread())\r\n                .subscribe(this::handleResults, this::handleError);\r\n<\/code><\/pre>\n<h3>\u8fd4\u7b54\u3092\u5909\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/h3>\n<p>POJO\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u5909\u63db\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>Observable&lt;List&lt;Crypto.Market&gt;&gt; btcObservable = cryptocurrencyService.getCoinData(\"btc\")\r\n                .map(result -&gt; Observable.fromIterable(result.ticker.markets))\r\n                .flatMap(x -&gt; x).filter(y -&gt; {\r\n                    y.coinName = \"btc\";\r\n                    return true;\r\n                }).toList().toObservable();\r\n\r\n        Observable&lt;List&lt;Crypto.Market&gt;&gt; ethObservable = cryptocurrencyService.getCoinData(\"eth\")\r\n                .map(result -&gt; Observable.fromIterable(result.ticker.markets))\r\n                .flatMap(x -&gt; x).filter(y -&gt; {\r\n                    y.coinName = \"eth\";\r\n                    return true;\r\n                }).toList().toObservable();\r\n\r\n        Observable.merge(btcObservable, ethObservable)\r\n                .subscribeOn(Schedulers.computation())\r\n                .observeOn(AndroidSchedulers.mainThread())\r\n                .subscribe(this::handleResults, this::handleError);\r\n<\/code><\/pre>\n<p>\u79c1\u305f\u3061\u306f\u3001Observable.fromIterable\u3092\u4f7f\u7528\u3057\u3066\u30de\u30c3\u30d7\u306e\u7d50\u679c\u3092Observable\u30b9\u30c8\u30ea\u30fc\u30e0\u306b\u5909\u63db\u3057\u307e\u3059\u3002flatMap\u306f\u8981\u7d20\u3054\u3068\u306b\u4f5c\u7528\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001ArrayList\u3092\u5358\u4e00\u306e\u8981\u7d20\u306b\u5909\u63db\u3057\u307e\u3059\u3002filter\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u5fdc\u7b54\u3092\u5909\u66f4\u3057\u307e\u3059\u3002toList()\u306fflatMap\u306e\u7d50\u679c\u3092List\u306b\u5909\u63db\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002toObservable()\u306f\u305d\u308c\u3089\u3092Observable\u30b9\u30c8\u30ea\u30fc\u30e0\u3068\u3057\u3066\u30e9\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30e1\u30a4\u30f3\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3.java<\/h3>\n<p>\u4e0b\u8a18\u306fMainActivity.java\u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.rxjavaretrofit;\r\n\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\nimport android.support.v7.widget.LinearLayoutManager;\r\nimport android.support.v7.widget.RecyclerView;\r\nimport android.util.Log;\r\nimport android.widget.Toast;\r\n\r\nimport com.google.gson.Gson;\r\nimport com.google.gson.GsonBuilder;\r\nimport com.scdev.rxjavaretrofit.pojo.Crypto;\r\n\r\nimport java.util.List;\r\n\r\nimport io.reactivex.Observable;\r\nimport io.reactivex.android.schedulers.AndroidSchedulers;\r\nimport io.reactivex.schedulers.Schedulers;\r\nimport okhttp3.OkHttpClient;\r\nimport okhttp3.logging.HttpLoggingInterceptor;\r\nimport retrofit2.Retrofit;\r\nimport retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;\r\nimport retrofit2.converter.gson.GsonConverterFactory;\r\n\r\nimport static com.scdev.rxjavaretrofit.CryptocurrencyService.BASE_URL;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n    RecyclerView recyclerView;\r\n    Retrofit retrofit;\r\n    RecyclerViewAdapter recyclerViewAdapter;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n\r\n        recyclerView = findViewById(R.id.recyclerView);\r\n        recyclerView.setLayoutManager(new LinearLayoutManager(this));\r\n        recyclerViewAdapter = new RecyclerViewAdapter();\r\n        recyclerView.setAdapter(recyclerViewAdapter);\r\n\r\n\r\n        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\r\n        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\r\n        OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();\r\n\r\n        Gson gson = new GsonBuilder()\r\n                .setLenient()\r\n                .create();\r\n\r\n        retrofit = new Retrofit.Builder()\r\n                .baseUrl(BASE_URL)\r\n                .client(client)\r\n                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())\r\n                .addConverterFactory(GsonConverterFactory.create(gson))\r\n                .build();\r\n\r\n\r\n        callEndpoints();\r\n    }\r\n\r\n    private void callEndpoints() {\r\n\r\n        CryptocurrencyService cryptocurrencyService = retrofit.create(CryptocurrencyService.class);\r\n\r\n        \/\/Single call\r\n        \/*Observable&lt;Crypto&gt; cryptoObservable = cryptocurrencyService.getCoinData(\"btc\");\r\n        cryptoObservable.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).map(result -&gt; result.ticker).subscribe(this::handleResults, this::handleError);*\/\r\n\r\n        Observable&lt;List&lt;Crypto.Market&gt;&gt; btcObservable = cryptocurrencyService.getCoinData(\"btc\")\r\n                .map(result -&gt; Observable.fromIterable(result.ticker.markets))\r\n                .flatMap(x -&gt; x).filter(y -&gt; {\r\n                    y.coinName = \"btc\";\r\n                    return true;\r\n                }).toList().toObservable();\r\n\r\n        Observable&lt;List&lt;Crypto.Market&gt;&gt; ethObservable = cryptocurrencyService.getCoinData(\"eth\")\r\n                .map(result -&gt; Observable.fromIterable(result.ticker.markets))\r\n                .flatMap(x -&gt; x).filter(y -&gt; {\r\n                    y.coinName = \"eth\";\r\n                    return true;\r\n                }).toList().toObservable();\r\n\r\n        Observable.merge(btcObservable, ethObservable)\r\n                .subscribeOn(Schedulers.computation())\r\n                .observeOn(AndroidSchedulers.mainThread())\r\n                .subscribe(this::handleResults, this::handleError);\r\n\r\n\r\n\r\n    }\r\n\r\n\r\n    private void handleResults(List&lt;Crypto.Market&gt; marketList) {\r\n        if (marketList != null &amp;&amp; marketList.size() != 0) {\r\n            recyclerViewAdapter.setData(marketList);\r\n\r\n\r\n        } else {\r\n            Toast.makeText(this, \"NO RESULTS FOUND\",\r\n                    Toast.LENGTH_LONG).show();\r\n        }\r\n    }\r\n\r\n    private void handleError(Throwable t) {\r\n\r\n        Toast.makeText(this, \"ERROR IN FETCHING API RESPONSE. Try again\",\r\n                Toast.LENGTH_LONG).show();\r\n    }\r\n\r\n}\r\n\r\n<\/code><\/pre>\n<p>handleResults\u3068handleError\u306f\u3001Java 8\u306einvocation ::\u3092\u4f7f\u7528\u3057\u3066\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002handleResults\u3067\u306f\u3001\u5909\u63db\u3055\u308c\u305f\u30ec\u30b9\u30dd\u30f3\u30b9\u3092ReyclerViewAdapter\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3082\u3057\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u30a8\u30e9\u30fc\u304c\u3042\u308b\u5834\u5408\u306f\u3001handleError()\u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002recyclerview_item_layout\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"https:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:app=\"https:\/\/schemas.android.com\/apk\/res-auto\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"&gt;\r\n\r\n    &lt;android.support.v7.widget.CardView\r\n        android:id=\"@+id\/cardView\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_gravity=\"center\"\r\n        android:layout_margin=\"16dp\"&gt;\r\n\r\n        &lt;android.support.constraint.ConstraintLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:padding=\"8dp\"&gt;\r\n\r\n            &lt;TextView\r\n                android:id=\"@+id\/txtCoin\"\r\n                android:layout_width=\"wrap_content\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_marginLeft=\"8dp\"\r\n                android:layout_marginRight=\"8dp\"\r\n                android:layout_marginTop=\"8dp\"\r\n                android:textAllCaps=\"true\"\r\n                android:textColor=\"@android:color\/black\"\r\n                app:layout_constraintHorizontal_bias=\"0.023\"\r\n                app:layout_constraintLeft_toLeftOf=\"parent\"\r\n                app:layout_constraintRight_toRightOf=\"parent\"\r\n                app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\r\n\r\n            &lt;TextView\r\n                android:id=\"@+id\/txtMarket\"\r\n                android:layout_width=\"wrap_content\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_marginLeft=\"8dp\"\r\n                android:layout_marginRight=\"8dp\"\r\n                android:layout_marginTop=\"8dp\"\r\n                app:layout_constraintHorizontal_bias=\"0.025\"\r\n                app:layout_constraintLeft_toLeftOf=\"parent\"\r\n                app:layout_constraintRight_toRightOf=\"parent\"\r\n                app:layout_constraintTop_toBottomOf=\"@+id\/txtCoin\" \/&gt;\r\n\r\n            &lt;TextView\r\n                android:id=\"@+id\/txtPrice\"\r\n                android:layout_width=\"wrap_content\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_marginLeft=\"8dp\"\r\n                android:layout_marginStart=\"8dp\"\r\n                android:layout_marginTop=\"8dp\"\r\n                app:layout_constraintHorizontal_bias=\"0.025\"\r\n                app:layout_constraintLeft_toLeftOf=\"parent\"\r\n                app:layout_constraintRight_toRightOf=\"parent\"\r\n                app:layout_constraintTop_toBottomOf=\"@+id\/txtMarket\" \/&gt;\r\n\r\n\r\n        &lt;\/android.support.constraint.ConstraintLayout&gt;\r\n    &lt;\/android.support.v7.widget.CardView&gt;\r\n&lt;\/LinearLayout&gt;\r\n<\/code><\/pre>\n<p>RecyclerViewAdapter.java\u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.rxjavaretrofit;\r\n\r\nimport android.graphics.Color;\r\nimport android.support.v4.content.ContextCompat;\r\nimport android.support.v7.widget.CardView;\r\nimport android.support.v7.widget.RecyclerView;\r\nimport android.view.LayoutInflater;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.widget.TextView;\r\n\r\nimport com.scdev.rxjavaretrofit.pojo.Crypto;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic class RecyclerViewAdapter extends RecyclerView.Adapter&lt;RecyclerViewAdapter.ViewHolder&gt; {\r\n\r\n    private List&lt;Crypto.Market&gt; marketList;\r\n\r\n\r\n    public RecyclerViewAdapter() {\r\n        marketList = new ArrayList&lt;&gt;();\r\n    }\r\n\r\n    @Override\r\n    public RecyclerViewAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,\r\n                                                             int viewType) {\r\n\r\n        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_item_layout, parent, false);\r\n\r\n        RecyclerViewAdapter.ViewHolder viewHolder = new RecyclerViewAdapter.ViewHolder(view);\r\n        return viewHolder;\r\n    }\r\n\r\n    @Override\r\n    public void onBindViewHolder(RecyclerViewAdapter.ViewHolder holder, int position) {\r\n        Crypto.Market market = marketList.get(position);\r\n        holder.txtCoin.setText(market.coinName);\r\n        holder.txtMarket.setText(market.market);\r\n        holder.txtPrice.setText(\"$\" + String.format(\"%.2f\", Double.parseDouble(market.price)));\r\n        if (market.coinName.equalsIgnoreCase(\"eth\")) {\r\n            holder.cardView.setCardBackgroundColor(Color.GRAY);\r\n        } else {\r\n            holder.cardView.setCardBackgroundColor(Color.GREEN);\r\n        }\r\n    }\r\n\r\n    @Override\r\n    public int getItemCount() {\r\n        return marketList.size();\r\n    }\r\n\r\n    public void setData(List&lt;Crypto.Market&gt; data) {\r\n        this.marketList.addAll(data);\r\n        notifyDataSetChanged();\r\n    }\r\n\r\n    public class ViewHolder extends RecyclerView.ViewHolder {\r\n\r\n        public TextView txtCoin;\r\n        public TextView txtMarket;\r\n        public TextView txtPrice;\r\n        public CardView cardView;\r\n\r\n        public ViewHolder(View view) {\r\n            super(view);\r\n\r\n            txtCoin = view.findViewById(R.id.txtCoin);\r\n            txtMarket = view.findViewById(R.id.txtMarket);\r\n            txtPrice = view.findViewById(R.id.txtPrice);\r\n            cardView = view.findViewById(R.id.cardView);\r\n        }\r\n    }\r\n}\r\n\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\uff1a \u4e0a\u8a18\u306e\u51fa\u529b\u306f\u3001\u30d3\u30c3\u30c8\u30b3\u30a4\u30f3\u3068\u30a4\u30fc\u30b5\u30ea\u30a2\u30e0\u306e\u5e02\u5834\u4fa1\u683c\u306e\u7d50\u679c\u3092Retrofit\u3092\u901a\u3058\u3066\u30de\u30fc\u30b8\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u7d42\u4e86\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089Android RxJavaRetrofit\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>RxJavaRetrofit\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Android\u30a2\u30d7\u30ea\u3067RxJava\u3092\u4f7f\u7528\u3057\u3066Retrofit\u306e\u547c\u3073\u51fa\u3057\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002Retrofit\u3068RxJava\u3092\u4f7f\u7528\u3057\u3066\u3001RecyclerView\u3092\u57cb\u3081\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002Cryp [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-721","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android RxJava \u3068 Retrofit - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Android RxJava \u3068 Retrofit\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-\u3068-retrofit\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android RxJava \u3068 Retrofit\" \/>\n<meta property=\"og:description\" content=\"Android RxJava \u3068 Retrofit\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-\u3068-retrofit\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-24T04:13:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T16:56:30+00:00\" \/>\n<meta name=\"author\" content=\"\u7dbe\u4e43, \u4e00\u5e0c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u7dbe\u4e43, \u4e00\u5e0c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"35\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/\",\"name\":\"Android RxJava \u3068 Retrofit - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-02-24T04:13:28+00:00\",\"dateModified\":\"2025-07-31T16:56:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/601389077b7f4e4ad6115428e3b73bff\"},\"description\":\"Android RxJava \u3068 Retrofit\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android RxJava \u3068 Retrofit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/601389077b7f4e4ad6115428e3b73bff\",\"name\":\"\u7dbe\u4e43, \u4e00\u5e0c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2228fe98b71141214fb24fb1b5ae44f99bdfa0602bbd89b351f2acd49ece862d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2228fe98b71141214fb24fb1b5ae44f99bdfa0602bbd89b351f2acd49ece862d?s=96&d=mm&r=g\",\"caption\":\"\u7dbe\u4e43, \u4e00\u5e0c\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/ayanokazuki\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Android RxJava \u3068 Retrofit - Blog - Silicon Cloud","description":"Android RxJava \u3068 Retrofit\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-\u3068-retrofit\/","og_locale":"ja_JP","og_type":"article","og_title":"Android RxJava \u3068 Retrofit","og_description":"Android RxJava \u3068 Retrofit\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-\u3068-retrofit\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-02-24T04:13:28+00:00","article_modified_time":"2025-07-31T16:56:30+00:00","author":"\u7dbe\u4e43, \u4e00\u5e0c","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u7dbe\u4e43, \u4e00\u5e0c","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"35\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/","name":"Android RxJava \u3068 Retrofit - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-02-24T04:13:28+00:00","dateModified":"2025-07-31T16:56:30+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/601389077b7f4e4ad6115428e3b73bff"},"description":"Android RxJava \u3068 Retrofit\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Android RxJava \u3068 Retrofit"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/601389077b7f4e4ad6115428e3b73bff","name":"\u7dbe\u4e43, \u4e00\u5e0c","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2228fe98b71141214fb24fb1b5ae44f99bdfa0602bbd89b351f2acd49ece862d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2228fe98b71141214fb24fb1b5ae44f99bdfa0602bbd89b351f2acd49ece862d?s=96&d=mm&r=g","caption":"\u7dbe\u4e43, \u4e00\u5e0c"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/ayanokazuki\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/android-rxjava-%e3%81%a8-retrofit\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":44181,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions\/44181"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}