preface

  • inAndrroidNetwork requests are very common in development
  • And in theAndroidIn the network request library,RetrofitIs one of the hottest network request library

  • Today, I’m going to present a very detailed oneRetrofit v2.0I hope you will enjoy this tutorial.

If you’re interested in the source code for Retrofit V2.0, check out Android: Take a step-by-step look at the source code for Retrofit 2.0


directory


1. Introduction

Special attention:

  • To be precise, Retrofit is an encapsulation of a RESTful HTTP Web request framework.
  • Reason: Network requests work by natureOkHttpDone, while Retrofit is only responsible for encapsulating the network request interface

  • App applications make requests through the Retrofit network, essentially encapsulating the request parameters, headers, urls, etc., using the Retrofit interface layer, and then OkHttp does the rest of the request
  • After the server returns the data, OkHttp hands the raw results to Retrofit, which parses the results based on the user’s needs

2. Compare with other open source request libraries

In addition to Retrofit, the main web request frameworks in Android today are:

  • Android-Async-Http
  • Volley
  • OkHttp

Here is a brief introduction:

One diagram lets you see all the network request libraries and the differences between them!


Attached: Github address of each major network request library

  • Android-Async-Http
  • Volley
  • OkHttp
  • Retrofit

3. Introduction to usage

There are seven steps to using Retrofit:

Step 1: Add the Retrofit library dependencies

Step 2: Create the class that receives the data returned by the server

Step 3: Create an interface to describe network requests

Step 4: Create an instance of Retrofit

Step 5: Create network request interface instances and configure network request parameters

Step 6: Send network requests (asynchronous/synchronous)

Encapsulates data conversion, thread switching operations

Step 7: Process the data returned by the server

Now, let’s go through it step by step.

Step 1: Add the Retrofit library dependencies

1. InGradlejoinRetrofitLibrary’s reliance on

build.gradle

dependencies {
    compile 'com. Squareup. Retrofit2: retrofit: 2.0.2'/ / Retrofit library}Copy the code

2. Add the network permission androidmanifest.xml

<uses-permission android:name="android.permission.INTERNET"/>
Copy the code

Step 2: Create the class that receives the data returned by the server

Reception.java

public class Reception { ... // According to the format of the returned data and how the data is parsed (Json, XML, etc.) // this is illustrated in examples below}Copy the code

Step 3: Create an interface to describe network requests

  • Retrofit abstracts Http requests into Java interfaces: annotations describing and configuring network request parameters
  1. Dynamic proxies are used to dynamically “translate” the interface’s annotations into an Http request, which is then executed
  2. Note: The parameters of each method in the interface must be annotated, otherwise an error will be reported

GetRequest_Interface.interface

public interface GetRequest_Interface {

    @GET("openapi.do? Keyfrom = Yanzhikai&key = 2032414398 & type = data&doctype = json&version = 1.1 & q = car") Call<Translation> getCall(); GetCall () = getCall() = Call<*>; // Call< Responsebody >; // Call< Responsebody >;Copy the code

The annotation types for the Retrofit Network request interface are detailed below.

Annotation type

Note that

Class 1: network request methods

A. @get, @POST, @PUT, @delete, and @HEAD correspond to network request modes in HTTP respectively

public interface GetRequest_Interface {

    @GET("openapi.do? Keyfrom = Yanzhikai&key = 2032414398 & type = data&doctype = json&version = 1.1 & q = car") Call<Translation> getCall(); // getCall() = the method to receive network request data // where the return type is Call<*>, * is the class to receive data (i.e. the Translation class defined above)}Copy the code

Retrofit breaks the URL of a web request into two parts:

// Part 1: Annotation set @get () on the network request interface"openapi.do? Keyfrom = Yanzhikai&key = 2032414398 & type = data&doctype = json&version = 1.1 & q = car") Call<Translation> getCall(); // Part 2: Setting Retrofit Retrofit = new Retrofit.builder ().baseurl () when creating a Retrofit instance"http://fanyi.youdao.com/") the requested Url / / set the network address. AddConverterFactory (GsonConverterFactory. The create ()) / / set data parser. The build (); // A request URL can be dynamically updated by replacing the block and request method parameters. // The replacement block is made up of strings wrapped in {} that is: Retrofit supports dynamic changes to the network request root directoryCopy the code
  • Full Url of web request =.baseurl () setting + annotation setting of web request interface when creating Retrofit instance (” path “below)
  • The specific rules of integration are as follows:

You are advised to use the third method and use the same path as possible.

b. @HTTP

  • Function: replace ** @get, @post, @PUT, @delete, @head ** annotation function and more functions expansion
  • Use the following attributes: Method, path, hasBody
Public interface GetRequest_Interface {/** * method: the method of the network request (case sensitive) * path: the address path of the network request * hasBody: whether the request body exists */ @http (method ="GET", path = "blog/{id}", hasBody = false)
    Call<ResponseBody> getCall(@Path("id") int id); // retrofit does not process the value of method.Copy the code

The second type: marking

a. @FormUrlEncoded

  • To send form-encoded data

Each key-value pair needs to be annotated with the @filed key name, and subsequent objects need to provide values.

b. @Multipart

  • To send form-encoded data (for file upload scenarios)

Each key-value pair needs to annotate the key name with @part, and subsequent objects need to provide values.

Use GetRequest_Interface

Public interface GetRequest_Interface {/** ** content-type :application/x-www-form-urlencoded) * <code>Field(content-type :application/x-www-form-urlencoded)"username"</code> </code> </code> </code>"/form")
        @FormUrlEncoded
        Call<ResponseBody> testFormUrlEncoded1(@Field("username") String name, @Field("age") int age); /** * {@link Part} {@ link RequestBody}, {@ link okhttp3. MultipartBody. Part}, any type * {@ link okhttp3. MultipartBody. Part}, Other types must bring the form fields ({@ link okhttp3. MultipartBody. Part} has been included in the form field information), * / @ POST ("/form")
        @Multipart
        Call<ResponseBody> testFileUpload1(@Part("name") RequestBody name, @Part("age") RequestBody age, @Part MultipartBody.Part file); } // Use GetRequest_Interface service = retrofit.create(GetRequest_Interface. // @FormUrlEncoded Call<ResponseBody> call1 = service.testFormUrlEncoded1("Carson", 24);
        
        //  @Multipart
        RequestBody name = RequestBody.create(textType, "Carson");
        RequestBody age = RequestBody.create(textType, "24");

        MultipartBody.Part filePart = MultipartBody.Part.createFormData("file"."test.txt", file);
        Call<ResponseBody> call3 = service.testFileUpload1(name, age, filePart);
Copy the code

The third type: network request parameters

Detailed instructions

a. @Header & @Headers

  • Action: Add request headers & Add unfixed request headers
  • Specific use is as follows:
// @Header
@GET("user")
Call<User> getUser(@Header("Authorization") String authorization)

// @Headers
@Headers("Authorization: authorization")
@GET("user"Call<User> getUser() // // The difference lies in the usage scenario and the usage mode // 1. Usage scenario: @header is used to add an unfixed request Header, and @headers is used to add a fixed request Header. @header applies to method arguments; @Headers is acting on the methodCopy the code

b. @Body

  • Role:PostMethod to pass custom data types to the server
  • Note in particular: if the submission is a Map, the effect is equivalent to@Field

But the Map is processed by the formBody. Builder class into an Okhttp form, as in:

FormBody.Builder builder = new FormBody.Builder();
builder.add("key"."value");

Copy the code

c. @Field & @FieldMap

  • What it does: Submits the requested form field when sending a Post request
  • Specific usage: and@FormUrlEncodedUse with annotations
Public interface GetRequest_Interface {/** ** content-type :application/x-www-form-urlencoded) * <code>Field(content-type :application/x-www-form-urlencoded)"username"</code> </code> </code> </code>"/form")
        @FormUrlEncoded
        Call<ResponseBody> testFormUrlEncoded1(@Field("username") String name, @Field("age") int age); /** * Map key as form key */ @post ("/form")
        @FormUrlEncoded
        Call<ResponseBody> testFormUrlEncoded2(@FieldMap Map<String, Object> map); } / / / / to use @ Field Call < ResponseBody > call1 = service. TestFormUrlEncoded1 ("Carson", 24); // @fieldMap // Implement the same effect as above, but pass Map Map<String, Object> Map = new HashMap<>(); map.put("username"."Carson");
        map.put("age", 24);
        Call<ResponseBody> call2 = service.testFormUrlEncoded2(map);
Copy the code

d. @Part & @PartMap

  • What it does: Submits the requested form field when sending a Post request

Difference with @field: It has the same function, but carries more parameter types, including data flow. Therefore, it is suitable for file upload scenarios

  • Specific usage: and@MultipartUse with annotations
Public interface GetRequest_Interface {/** * {@link Part} {@ link RequestBody}, {@ link okhttp3. MultipartBody. Part}, any type * {@ link okhttp3. MultipartBody. Part}, Other types must bring the form fields ({@ link okhttp3. MultipartBody. Part} has been included in the form field information), * / @ POST ("/form")
        @Multipart
        Call<ResponseBody> testFileUpload1(@Part("name") RequestBody name, @Part("age") RequestBody age, @Part MultipartBody.Part file); /** * PartMap annotation supports a Map as a parameter, supports {@link RequestBody} type, * if there are other types, will be {@link retrofit2.converter} conversion, As introduced in later use {@ link com. Google. Gson. Gson} of {@ link retrofit2. Converter. Gson. GsonRequestBodyConverter} * so {@ the link <b> @part multipartbody. Part </b> */ @post ("/form")
        @Multipart
        Call<ResponseBody> testFileUpload2(@PartMap Map<String, RequestBody> args, @Part MultipartBody.Part file);

        @POST("/form")
        @Multipart
        Call<ResponseBody> testFileUpload3(@PartMap Map<String, RequestBody> args); } textType = MediaType. Parse ("text/plain");
        RequestBody name = RequestBody.create(textType, "Carson");
        RequestBody age = RequestBody.create(textType, "24");
        RequestBody file = RequestBody.create(MediaType.parse("application/octet-stream"), "Here are the contents of the mock file.");

        // @Part
        MultipartBody.Part filePart = MultipartBody.Part.createFormData("file"."test.txt", file); Call<ResponseBody> call3 = service.testFileUpload1(name, age, filePart); ResponseBodyPrinter.printResponseBody(call3); Map<String, RequestBody> fileUpload2Args = new HashMap<>(); fileUpload2Args.put("name", name);
        fileUpload2Args.put("age", age); // This is not considered a file because there is no file name (contained in the Content-Disposition request header), but the filePart above has // fileupload2args.put ("file", file); Call<ResponseBody> call4 = service.testFileUpload2(fileUpload2Args, filePart); / / file separate ResponseBodyPrinter printResponseBody (call4); }Copy the code

E. @ Query and @ QueryMap

  • Function: used of@GETMethod’s Query parameter (Query = ‘? ‘after key-value)

For example: url = www.println.net/?cate=andro… = cate

  • Specific usage: You only need to add a parameter to the interface method:
   @GET("/")    
   Call<String> cate(@Query("cate") String cate); } // It is used in the same way as @field and @fieldMap, which is not described too much hereCopy the code

f. @Path

  • Effect: Default VALUE of the URL address
  • Specific use:
public interface GetRequest_Interface {

        @GET("users/{user}/repos")
        Call<ResponseBody>  getBlog(@ Path ("user") String user); / / access API is: https://api.github.com/users/ {user} / repos / / in a request, the method of {user} will be replaced by the first parameter to the user (@ Path annotations)}Copy the code

g. @Url

  • Purpose: Pass in a request URL variable directly for URL setting
  • Specific use:
public interface GetRequest_Interface {

        @GET
        Call<ResponseBody> testUrlAndQuery(@Url String url, @Query("showAll") boolean showAll); // The URL passed by @get can be omitted when GET, POST... If a Url is not set in a method such as HTTP, it must be provided by {@link Url}.Copy the code

summary

Step 4: Create an instance of Retrofit

 Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("http://fanyi.youdao.com/") the requested Url / / set the network address. AddConverterFactory (GsonConverterFactory. The create ()) / / set data parser AddCallAdapterFactory (RxJavaCallAdapterFactory. The create ()) / / support RxJava platform. The build ();Copy the code

A. About Data Parser (Converter)

  • Retrofit supports multiple ways of parsing data
  • To use it, you need to add dependencies to Gradle
Data parser Gradle rely on
Gson Com. Squareup. Retrofit2: converter – gson: 2.0.2
Jackson Com. Squareup. Retrofit2: converter – Jackson: 2.0.2
Simple XML Com. Squareup. Retrofit2: converter – simplexml: 2.0.2
Protobuf Com. Squareup. Retrofit2: converter – protobuf: 2.0.2
Moshi Com. Squareup. Retrofit2: converter – moshi: 2.0.2
Wire Com. Squareup. Retrofit2: converter – wire: 2.0.2
Scalars Com. Squareup. Retrofit2: converter – scalars: 2.0.2

B. About Network Request Adapter (CallAdapter)

  • Retrofit supports a variety of network request adapter approaches: Guava, Java8, and RXJava

If you use the default Android CallAdapter, you do not need to add the network request adapter dependency. Otherwise, you need to add the Retrofit CallAdapter as required

  • You need to add a dependency to Gradle:
Network request adapter Gradle rely on
guava Com. Squareup. Retrofit2: adapter – guava: 2.0.2
Java8 Com. Squareup. Retrofit2: adapter – java8:2.0.2
rxjava Com. Squareup. Retrofit2: adapter – rxjava: 2.0.2

Step 5: Create the network request interface instance

GetRequest_Interface request = retrofit.create(getrequest_interface.class); Call<Reception> Call = request.getCall();Copy the code

Step 6: Send network requests (asynchronous/synchronous)

Encapsulates data conversion, thread switching operations

Call.enqueue (new Callback<Translation>() {Callback @override public void onResponse(call <Translation>); Call, Response<Translation> Response) {response.body().show(); @override public void onFailure(Call<Translation> Call, Throwable Throwable) {system.out.println ("Connection failed"); }}); Response<Reception> Response = call.execute();Copy the code

Step 7: Process the returned data

The returned data is processed through the body () of the Response class

Call.enqueue (new Callback<Translation>() {Callback @override public void onResponse(call <Translation>); Call, Response<Translation> Response) {response.body().show(); @override public void onFailure(Call<Translation> Call, Throwable Throwable) {system.out.println ("Connection failed"); }}); Response<Reception> Response = call.execute(); Response.body ().show();Copy the code

4. Examples

Next, I’ll use two examples of Retrofit GET and POST for network requests.

4.1 instance 1

  • Implementation function: Translate Chinese into English
  • Implementation scheme: adoptGetMethod send network request to Kingsoft POWERword API

Gson is used for data parsing

  • Step-by-step instructions

Step 1: Add the Retrofit library dependencies

Step 2: Create the class that receives the data returned by the server

Step 3: Create an interface to describe network requests

Step 4: Create an instance of Retrofit

Step 5: Create network request interface instances and configure network request parameters

Step 6: Send network requests (using the most common asynchronous mode)

Encapsulates data conversion, thread switching operations

Step 7: Process the data returned by the server

Now, let’s go through it step by step.

  • The specific use

Step 1: Add the Retrofit library dependencies

1. InGradlejoinRetrofitLibrary’s reliance on

build.gradle

dependencies {
    compile 'com. Squareup. Retrofit2: retrofit: 2.0.2'/ / Retrofit library}Copy the code

2. Add the network permission androidmanifest.xml

<uses-permission android:name="android.permission.INTERNET"/>
Copy the code

Step 2: Create the class that receives the data returned by the server

  • Kingsoft POWERword API data format description is as follows:
/ / http://fy.iciba.com/ajax.php / / URL examples http://fy.iciba.com/ajax.php?a=fy&f=auto&t=auto&w=hello%20world URL template / / parameter description: // a: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // f: fy // Text type: Ja for Japanese, zh for Chinese, EN for English, KO for Korean, DE for German, ES for Spanish, FR for French, auto // w for automaticCopy the code

  • According to kingsoft POWERword API data format, create a class to receive the data returned by the server:

Translation.java

public class Translation { private int status; private content content; private static class content { private String from; private String to; private String vendor; private String out; private int errNo; } // Define the method that outputs the returned data public voidshow() { System.out.println(status); System.out.println(content.from); System.out.println(content.to); System.out.println(content.vendor); System.out.println(content.out); System.out.println(content.errNo); }}Copy the code

Step 3: Create an interface to describe network requests

Use the ** annotation ** to describe the network request parameters. GetRequest_Interface.java

public interface GetRequest_Interface {
    
 @GET("ajax.php? a=fy&f=auto&t=auto&w=hello%20world") Call<Translation> getCall(); // Retrofit breaks the URL of the web request into two parts: // If the url in the interface is a complete WEB address, then the URL in the Retrofit object can be ignored. // getCall() is the method that accepts the web request data.Copy the code

The next steps are inGetRequest.javaInternal implementation (see comments)

Step 4: Create a Retrofit object Step 5: create an instance of the network request interface Step 6: send a network request

Take the most common asynchronous request as an example

Step 7: Process the returned data

GetRequest.java

public class GetRequest extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); request(); // Use Retrofit encapsulated methods} public voidrequest() {// Step 4: Create Retrofit object Retrofit Retrofit = new retrofit.builder ().baseurl ()"http://fy.iciba.com/") / / set the network request Url. AddConverterFactory (GsonConverterFactory. The create ()) / / set the use Gson parsing (remember to join dependence). The build (); // Step 5: Create an instance of the network request interface. GetRequest_Interface Request = retrofit.create(GetRequest_Interface. Call<Translation> Call = request.getCall(); Call.enqueue (new Callback<Translation>() {@override public void onResponse(call <Translation>); Call, Response<Translation> Response) {// Step 7: process the returned data result response.body().show(); } @override public void onFailure(Call<Translation> Call, Throwable Throwable) {system.out.println ("Connection failed"); }}); }}Copy the code

Since Gson parsing is used here, you need to add the build. Gradle dependency to Gradle

compile 'com. Squareup. Retrofit2: converter - gson: 2.0.2'
Copy the code

The results

The Demo address

Carson_Ho’s Github: github.com/Carson-Ho/R…


4.2 instance 2

  • Function: Translate English into Chinese
  • Implementation method: adoptPost methodSend a network request to the Youdao API

Gson is used for data parsing

  • Using the step

Step 1: Add the Retrofit library dependencies

Step 2: Create the class that receives the data returned by the server

Step 3: Create an interface to describe network requests

Step 4: Create an instance of Retrofit

Step 5: Create network request interface instances and configure network request parameters

Step 6: Send network requests (using the most common asynchronous mode)

Encapsulates data conversion, thread switching operations

Step 7: Process the data returned by the server

Next, we took Retrofit step by step.

  • The specific use

Step 1: Add the Retrofit library dependencies

1. InGradlejoinRetrofitLibrary’s reliance on

build.gradle

dependencies {
    compile 'com. Squareup. Retrofit2: retrofit: 2.0.2'/ / Retrofit library}Copy the code

2. Add the network permission androidmanifest.xml

<uses-permission android:name="android.permission.INTERNET"/>
Copy the code

Step 2: Create the class that receives the data returned by the server

  • The API data format is described as follows:
URL / / http://fanyi.youdao.com/translate / / http://fanyi.youdao.com/translate?doctype=json&jsonversion=& URL examplestype=& keyFrom =& Model =&mid=&imei=& Vendor =&screen=& SSID =&network=&abtest= // Parameter Description // docType: json or XML // jsonVersion: XmlVersion: If the doctype value is json, remove this value. If the doctype value is XML, the value is emptytype: Null for automatic language detection, null for automatic language detection. EN2ZH_CN in English, ZH_CN2EN in Chinese, JA2ZH_CN in Japanese, ZH_CN2JA in Chinese, ZH_CN2KR in Korean, ZH_CN2FR in Chinese, FR2ZH_CN // keyform: mdict. Mobile platform. Empty // Model: indicates the mobile phone model. Null // mid: platform version. Void // imei:?? . Null // vendor: app download platform. Void // screen: width and height of the screen. Ssid: indicates the user name. // abtest:?? . // Request format: X-www-form-urlencoded // Request format: POST // Request body: I // Request format: X-www-form-urlencodedCopy the code

  • According to the data format of youdao API, create a class to receive the data returned by the server:

Translation.java

public class Translation1 {

    private String type;
    private int errorCode;
    private int elapsedTime;
    private List<List<TranslateResultBean>> translateResult;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public List<List<TranslateResultBean>> getTranslateResult() {
        return translateResult;
    }

    public void setTranslateResult(List<List<TranslateResultBean>> translateResult) { this.translateResult = translateResult; } public static class TranslateResultBean {/** * SRC: merry me * TGT: merry */ public String SRC; public String tgt; public StringgetSrc() {
            return src;
        }

        public void setSrc(String src) {
            this.src = src;
        }

        public String getTgt() {
            return tgt;
        }

        public void setTgt(String tgt) { this.tgt = tgt; }}}Copy the code

Step 3: Create an interface to describe network requests

Use annotations to describe network request parameters.

PostRequest_Interface.java

public interface PostRequest_Interface {

    @POST("translate? doctype=json&jsonversion=&type=&keyfrom=&model=&mid=&imei=&vendor=&screen=&ssid=&network=&abtest=")
    @FormUrlEncoded
    Call<Translation1> getCall(@Field("i") String targetSentence); // @post for Post (partial URL) // @formurlencoded annotation: THE API specifies the request format X-www-form-urlencoded (form) // @field is required Submit the required fields to the server}Copy the code

The next steps are all implemented in Postrequest.java (see comments)

Step 4: Create a Retrofit object

Step 5: Create an instance of the network request interface

Step 6: Send a network request

Take the most common asynchronous request as an example

Step 7: Process the returned data

PostRequest.java

public class PostRequest extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        request();
    }
    public void request() {// Step 4: Create Retrofit object Retrofit Retrofit = new retrofit.builder ().baseurl ()"http://fanyi.youdao.com/") / / set the network request Url. AddConverterFactory (GsonConverterFactory. The create ()) / / set the use Gson parsing (remember to join dependence). The build (); PostRequest_Interface Request = retrofit.create(postrequest_interface.class); // Step 5: Create an instance of the network request interface. Call<Translation1> Call = request.getCall("I love you"); // Step 6: Send the network request (asynchronous) call.enqueue(new Callback<Translation1>() {@override public void if the request succeeds OnResponse (Call<Translation1> Call, Response<Translation1> Response) {// Step 7: handle the returned data result: System.out.println(response.body().getTranslateresult ().get(0).get(0).gettgt ()); } @override public void onFailure(Call<Translation1> Call, Throwable Throwable) {system.out.println ("Request failed"); System.out.println(throwable.getMessage()); }}); }}Copy the code

Since Gson parsing is used here, you need to add the build. Gradle dependency to Gradle

compile 'com. Squareup. Retrofit2: converter - gson: 2.0.2'
Copy the code

The results

The Demo address

Carson_Ho’s Github: github.com/Carson-Ho/R…


5. Expanded use of Retrofit

  • Retrofit has a variety of usage scenarios, such as supportRxJavaandPrototocobuff
  • The specific Settings are also very simple & convenient:
Retrofit = new Retrofit.builder ().baseurl ()""http://fanyi.youdao.com/""). AddConverterFactory (ProtoConverterFactory. The create ()) / / support Prototocobuff parsing AddConverterFactory (GsonConverterFactory. The create ()) / / support Gson parsing AddCallAdapterFactory (RxJavaCallAdapterFactory. The create ()) / / support RxJava. The build ();Copy the code

Details on the use of RxJava are not covered here, but look forward to the next article on RxJava.


6. Summary

  • After reading this article, I believe you are very familiar with itRetrofit 2.0The use of
  • If you wish to continue readingRetrofit 2.0See the article I wrote:Android: Take you hand by hand through Retrofit 2.0 source code
  • Next, I’ll continue my analysis of RxJava used with Retrofit, but if you’re interested, follow Carson_Ho’s Android development notes

Thumb up, please! Because your encouragement is the biggest power that I write!


Welcome to follow Carson_ho on wechat