O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up Retrofit

First of all, we will add these dependencies in the build.gradle file to set up Retrofit:

compile 'com.squareup.retrofit2:retrofit:2.1.0'compile 'com.squareup.retrofit2:converter-gson:2.1.0'compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'compile 'com.squareup.okhttp3:logging-interceptor:3.5.0'

Consider the following line:

compile 'com.squareup.retrofit2:retrofit:2.1.0'

It adds the core Retrofit libraries to the project. Now, consider this:

compile 'com.squareup.retrofit2:converter-gson:2.1.0'

It makes the GsonConverterFactory class available, which is used internally by Retrofit to parse JSON responses.

Consider the record of the following:

compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required