Link in this article
In a certain interface, the user initiates a network request. For some reason, the user leaves the current interface before the network request is completed. A better way is to cancel the network request. For OkHttp, it is specifically to Call the cancel method of Call.
How can I find this network request and ca ...
Posted on Sat, 19 Oct 2019 07:58:05 -0400 by lucerias
Instead of rxjava and retrofit, I'm going to go straight to 2, because 2 encapsulates better and more useful.
1. Observer model
For example, a common button click event is that a button is an observer, a listener is an observer, and a setOnClickListener process is a subscription. With a subscription relationship, when a button is clicked, the l ...
Posted on Thu, 10 Oct 2019 08:27:09 -0400 by thebluebus
Retrofit and RXJava What are they? They are the most popular ones we use now. Of course, they are also the ones we use now. Retrofit and RXJava Combine them. Here's the simplest combination of the two.
First, we add dependencies and network privileges
implementation 'io. ...
Posted on Wed, 07 Aug 2019 08:37:37 -0400 by Skull
This article was first published on vivo Internet Technology WeChat Public Number https://mp.weixin.qq.com/s/TXFt7ymgQXLJyBOJL8F6xg Author: Zhu Yifei
ARetrofit is a routing framework for communication between Android components and a tool for rapid component development.This paper mainly describes the principle of ARetrofit implementation ...
Posted on Mon, 05 Aug 2019 21:49:23 -0400 by benwestgarth
I haven't shared the source code for a while. In the last two days, I have time to look at the Retrofit source code. One is to improve the original understanding, the other is to share with you some misunderstanding deviations. I hope you can criticize them. Retrofit has been on fire for a long time ...
Posted on Wed, 24 Jul 2019 07:46:58 -0400 by Graeme1972
In the last year and a half, it is really a big eye-opener. Faced with all kinds of exotic interfaces, in the compact development cycle, there is no time to think about how to face them. Fortunately, in the recent leisure, I sorted out all kinds of exotic interfaces I met, wrote Spring to simulate these interfaces, and then tried to break them ...
Posted on Fri, 19 Jul 2019 01:50:08 -0400 by babygodzilla
RxAndroid is a powerful framework, which means the cost of mastering is relatively high. It has been studied intermittently for a long time. Today, when it is written out, the output is the better input.
What is Rx
Rx is not a new language, but a common Java pattern, similar to Observer Pattern, which can be regarded as a common Java class ...
Posted on Wed, 10 Jul 2019 17:02:41 -0400 by MattG
With the abandonment of HttpClient by Google and the gradual decline of Volley, okHttp began to emerge, while Retrofit imposed a compulsory dependence on okHttp.
Retrofit is made by Square The company's products are aimed at Android and Java Type-safe Http clients,
If you look at the source code, you will find that it i ...
Posted on Sat, 06 Jul 2019 15:51:35 -0400 by jonoc33
Recently, I just quit my job, and I was asked in an interview the other day whether I know about the use of Retrofit, but I really haven't used it very much. A search on the Internet, what? You're out before you use Retrofit2!!! It was naked ridiculed by these words. Okay, let's go to the toilet to have a cigarette and calm down for a while, t ...
Posted on Fri, 05 Jul 2019 16:47:08 -0400 by dzysyak
I learned about annotations and agents the other day. Here's a record of using custom annotations + dynamic proxies to mimic Retrofit's way of passing parameters.
There are four kinds of Java meta-annotations, which are defined by the system to distinguish their different roles when defining annotations.
Posted on Wed, 26 Jun 2019 13:09:37 -0400 by kimbhoot