Get messages from the server regularly

Function Description: There is a message function in the interface. Click message to view the message list. Regularly send the request interface to the server to obtain the latest messages, and display the number of messages in the form of corner marks to the message function, Thus, users can intuitively know that they have received several m ...

Posted by vidhu on Fri, 13 Dec 2019 07:04:20 -0800

engine mode encapsulates the asynchronous GET of OkHttp

OkHttpEngine First, OkHttp is obtained through the singleton mode. The singleton pattern has a private constructor and a static get method. Let's see what we've done in the constructor first. private OkHttpEngine(Context context) { File sdcache = context.getExternalCacheDir(); int cacheSize = 10 * 1024 * 102 ...

Posted by cameeob2003 on Wed, 20 Nov 2019 07:18:15 -0800

OkHttp3 source code details okhttp connection pool reuse mechanism

1. Overview To improve network performance optimization, it is very important to reduce latency and improve response speed. Usually, when we make a request in the browser, the header part is like this Keep alive is to keep a long connection between the browser and the server, which can be reused. It is enabled by default in HTTP 1.1. Why does ...

Posted by tempa on Mon, 18 Nov 2019 02:01:01 -0800

(android Development) upload files using okhttp

To develop android mobile client, you often need to upload files to the server, such as: photos in your mobile phone. Using okhttp would be a good choice. It is easy to use and efficient to run. First, add implementation 'com. Square up. Okhttp3: okhttp: 3.8.1' in the dependencies of app/build.gradle. You can refer to the following ...

Posted by kayess2004 on Sat, 02 Nov 2019 12:23:41 -0700

About the use of config.gradle

Last night, I read this article and mentioned config.gradle, such a configuration, so today I found a DEMO to try, record and summarize it. This diagram is a directory structure   config.gradle--project ext { android = [ compileSdkVersion: 28, buildToolsVersion: "28 ...

Posted by maya28 on Thu, 31 Oct 2019 08:50:07 -0700

github Certified Logon

Use github OAuth for user login When doing the login function, you are allowed to use the identity of a third-party website, which is called "third-party login". principle Authentication methods within github Apply for OAuth App on github, go to your personal Github homepage, Settings->Applications->Developer application ...

Posted by MishaPappa on Thu, 26 Sep 2019 20:01:05 -0700

Android Common Design Patterns 10: Build Patterns

For developers, design patterns can sometimes be a barrier, but design patterns can be very useful, beyond which you can move up a notch.In the development of Android, it is necessary to know some design patterns, because design patterns are ubiquitous in Android source code.For students who want to study design mode systematically, here is a B ...

Posted by BenGilbert on Wed, 25 Sep 2019 19:56:45 -0700

RestTemplate related components: Client HttpRequest Interceptor

Each sentence The biggest difference between people who do things and people who dream is their ability to act. Preface This article provides an in-depth understanding of Spring's Rest Call Client RestTemplate and explains some of its related components. Tips: Please pay attention to distinguishing RestTemplate from RedisTemplate.~ ClientHttpRe ...

Posted by jonker on Mon, 16 Sep 2019 21:27:59 -0700

OkHttp Source Code Analysis

From the previous article, we briefly analyzed the okhttp request process.( Okhttp Source Code Analysis (I) Today, let's take a look at the core of okhttp. Put a picture first. okhttp network requests adopt a hierarchical + Chain structure. Ea ...

Posted by sbarros on Tue, 03 Sep 2019 02:35:41 -0700

Okhttp3 Source Parsing Interceptor

Preface Review: Basic usage of Okhttp Okhttp3 Source Parsing (1)-OkHttpClient Analysis Okhttp3 Source Parsing (2)-Request Analysis Okhttp3 Source Parsing (3)-Call Analysis (Overall Process) Okhttp3 Source Parsing (4) - Interceptor and Design Mode Okhttp3 Source Parsing (5) - Interceptor RetryAndFollowUpInterceptor Today, when we talk about Bri ...

Posted by travelkind on Thu, 29 Aug 2019 17:51:44 -0700