Posts

Showing posts with the label retrofit

Retrofit 2 : REST Client for Android

Image
Using RxJava with Retrofit Add the following dependencies in Module level  build.gradle file: dependencies { /// ... // Add Retrofit implementation 'com.squareup.retrofit2:retrofit:2.5.0' // Using gson as converter implementation 'com.squareup.retrofit2:converter-gson:2.5.0' // A Converter which supports converting strings and both primitives and their boxed types to text/plain bodies. implementation 'com.squareup.retrofit2:converter-scalars:2.5.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' // Because RxAndroid releases are few and far between, it is recommended you also // explicitly depend on RxJava's latest version for bug fixes and new features. // (see https://github.com/ReactiveX/RxJava/releases for latest 2.x.x version) implementation 'io.reactivex.rxjava2:rxjava:2.2.8' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0' implement