Simple combination of Retrofit and OkHttp

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

Self made certificate of Android HTTPS realizes bidirectional authentication (OkHttp + Retrofit + Rxjava)

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

Record of Retrofit+MVP framework encapsulation

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 package com.fragmentapp.login.presenter; import android.util.Log; import com.fragmentapp.base.BasePresenter; import com.fragmentapp.http.BaseObserver; impor ...

Posted by jredwilli on Sat, 02 May 2020 08:14:47 +0200

Retrofit+SwipeRefreshlayout+RecyclerView to implement pull-up refresh and paging load

Preface: 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

At a glance: steps to build Retrofit2+RxJava2+ButterKnife framework

Step introduction: Code resolution: Step introduction: 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

Solve the problem of using Okhttp+Retrofit to send network request and get json is unicode

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

The implementation of Okhttp multi network communication

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. Prerequisites: 1) android system version on the cont ...

Posted by jordan00 on Wed, 01 Jan 2020 10:22:38 +0100

Using Kotlin to write basic network requests

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: //Retrofit implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation "com.squareup.retrofit2:adapt ...

Posted by deolsabh on Wed, 18 Dec 2019 18:35:07 +0100

Writing android with Kotlin: retrofit + rxjava try

Recently, I learned the Kotlin language recommended by Google for Android development, which was used to try to reconstruct the MVP+Retrofit+Rxjava code before. Here is my reconstructed Kotlin code First add the compile of gradle: dependencies { compile 'io.reactivex.rxjava2:rxjava:2.0.7' compile 'io.reactivex.rxjava2:rx ...

Posted by jl9148 on Wed, 11 Dec 2019 01:11:15 +0100

First use of Retrofit

Rxprofile library is a well written network framework library, which is imported into its own project as a local Module first. 1. Most of its initialization operations are completed in user-defined application s, such as: public class App extends Application { @Override public void onCreate() { super.onCreate(); ...

Posted by SFDonovan on Thu, 05 Dec 2019 21:51:52 +0100