Current version: 2.7.1
Official document: https://square.github.io/retrofit/Retrofit It is a RESTful encapsulation of HTTP network request framework.
Add a dependency on the Retrofit Library
implementation 'com.squareup.retrofit2:retrofi ...
Posted by Sgt.Angel on Tue, 11 Feb 2020 09:26:35 -0800
4, Source code analysis
4.1. Create retrofit
4.1.2. Add baseUrl
4.1.3. Add GsonConverterFactory
4.2. Create network request
4.3. Call the network request API, generate a call, and execute the reque ...
Posted by jandrews on Wed, 29 Jan 2020 04:17:57 -0800
To be a great Android developer, you need a complete Knowledge System Here, let's grow up as we want.
tips: articles are too long to favor your collection first, then read them slowly ~
In the first two chapters, we have analyzed the core source code of OKHttp, the underlying framework of A ...
Posted by GetReady on Thu, 16 Jan 2020 18:29:25 -0800
Recently, I have been looking at Kotlin's Android code. By comparing Java, Kotlin is indeed a trend. Today, I will introduce how to integrate network requests into MVP mode. Some people may have a good understanding of some conceptual things, but the actual operation is another matter... This time, I ...
Posted by alexweb on Sat, 11 Jan 2020 05:20:17 -0800
Article 3 of the seriesTo undertake the above: RXjava parsing (2) I gave you the source code of RXjava and this interview, and you told me that I couldn't get an offer?(leave the GitHub link, and you can find the content you need to obtain such as interview)https://github.com/xiangjiana/Android-MS
Back pressure problem
Backpressure refers to ...
Posted by email@example.com on Fri, 10 Jan 2020 07:09:03 -0800
Feign is a Restful client component of Java. Feign makes it easier to write Java HTTP client. Feign was inspired by Retrofit, JAXRS-2.0 and WebSocket. Feign has nearly 3K stars on github, which is a quite excellent open source component. Although it is inferior to nearly 30K stars of Retrofit, spring cloud integrates feign, w ...
Posted by jfgreco915 on Mon, 23 Dec 2019 02:05:29 -0800
These two frameworks are very popular now. The combination of strong and strong forces makes our efficiency more direct
First, we need to import the dependencies
implementation 'com.google.code.gson:gson:2.8. ...
Posted by 25lez25 on Tue, 17 Dec 2019 10:14:25 -0800
1. A common network request process in development
url, parameter -- > request -- > Convert to Http protocol -- > request execution -- > return result -- > Convert to response -- > response convert to our object
Only the head and tail are customized by our daily development, and other processes in the middle are carried out ...
Posted by hankster on Mon, 16 Dec 2019 04:55:18 -0800
For the basic use of Retrofit2, please refer to Java Retrofit2 uses
By default, the supported conversions of retrofit are Gson,Jackson,Moshi
Here, we will customize a FastJsonConverterFactory to parse the returned data, which internally uses Alibaba's fastjson (depends on adding compile 'com.a ...
Posted by Memphis10 on Wed, 11 Dec 2019 07:42:17 -0800
RxJava2 and Retrofit2 are old partners. Previously, I wrote a "unified processing of single request by RxJava and Retrofit2", which is Rxjava1.0. This time, Rxjava2.0 and Retrofit2 are used for encapsulation, which is clean, simple and practical. Compared with Rxjava1, RxJava2 optimizes and changes many things. There are ...
Posted by phpmixx on Wed, 11 Dec 2019 07:20:10 -0800