1. ForewordPeople keep asking me, RxHttp What are the advantages over Retrofit? Here, I would like to talk about my ideas in terms of stability, functionality and ease of use.First of all, let me state that the emergence of RxHttp is not to kill anyone, but to give you more choices and different choices.stabilityI always think that Retrofit is ...
Posted by maff20 on Tue, 25 Jan 2022 11:11:17 +0100
In our request network, there are many kinds of network request modes, so two kinds of network request modes, Retrofit and OkHttp, can be used together. Both Retrofit and OkHttp are released by Square company. The bottom layer of Retrofit encapsulates OkHttp. I use MVP mode here to encapsulate a network request~~
Custom tool class
public cla ...
Posted by jbulaswad on Sun, 31 May 2020 19:11:27 +0200
Due to a high security project to be done recently, it needs to use HTTPS for two-way authentication. When designing the project architecture, the client uses MVVM architecture, and realizes Android based on DataBinding + Retrofit + Rxjava.
Looking up a lot of data, there are many examples of implementing two-way authentication based on native ...
Posted by okyejr on Thu, 21 May 2020 06:36:59 +0200
The most popular combination of network requests, retrofit2+okhttp+rxjava+mvp
This is the sealed record
First, it is divided into modules, such as login
First, the use of encapsulation
Posted by jredwilli on Sat, 02 May 2020 08:14:47 +0200
In the process of project development, we usually have the demand of "paging load". Paging load is to display data in the form of list. On the premise of having a network, we can manually obtain more data through pull-down refresh. When there is no more data, we will be reminded that we do not have more data. & ...
Posted by jakeklem on Fri, 03 Apr 2020 03:29:53 +0200
Add dependencies for Retrofit2 and RxJava2 libraries:
Create a class that accepts the data returned by the server (the class used to process the data)
Create an interface to describe network requests and configure network request parameters
Create Retrofit inst ...
Posted by mobilekid on Thu, 02 Apr 2020 16:10:36 +0200
When we use Okhttp and Retrofit to send network requests, the man in the json we get is unicode code, as shown in the figure below
At this time, we need to set the network editor when Okhttp is initialized, and change the return value code to UTF-8
OKhttp previously set
HttpLoggingInterceptor logging = new HttpLogg ...
Posted by davidb on Fri, 03 Jan 2020 01:59:46 +0100
In recent project requirements, android needs to be able to access the internal and external networks at the same time, that is, different communications go through different networks, and it is feasible to check relevant information, but certain conditions are required
1) android system version on the cont ...
Posted by jordan00 on Wed, 01 Jan 2020 10:22:38 +0100
The source download link has been given at the end of the article
First, add the dependency required by the network request to build.gradle:
implementation "com.squareup.retrofit2:adapt ...
Posted by deolsabh on Wed, 18 Dec 2019 18:35:07 +0100