[knowledge points] OkHttp principle 8 questions
prefaceOkHttp can be said to be the most common network request framework in Android development. OkHttp is easy to use, extensible and powerful. OkHttp source code and principle are also frequent visitors in the interview However, OKHttp has a lot of source code content. If you want to learn its source code, you are often confused and can't g ...
Posted by superhoops on Thu, 16 Dec 2021 17:47:02 +0100
Introduction to Android | how to use MediaCodec codec
Android MediaCodec codec usageUse MediaCodec for encoding and decoding. Input data in H.264 format, output frame data and send it to the listener.Next, we call MediaCodec codec for shortH.264 configurationCreate and configure codec. When configuring codec, if you manually create MediaFormat objects, you must remember to set "csd-0" an ...
Posted by jviney on Thu, 16 Dec 2021 14:55:05 +0100
Android official architecture component - Lifecycle
What is Lifecycle?Lifecycle components refer to Android arch. Various classes and interfaces provided under the lifecycle package allow developers to build classes that can sense the lifecycle aware of other components (mainly activities and fragments).Why introduce Lifecycle?As I said earlier, Lifecycle enables developers to build classes that ...
Posted by richardk1 on Thu, 16 Dec 2021 12:37:03 +0100
30 seconds to start the new generation of Http request artifact RxHttp, IDEA is too strong
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies { implementation 'com.github.liujingxing.rxhttp:rxhttp:2.6.0' implementation ‘com.squareup.okhttp3:okhttp:4.9.0’ //rxhttp v2. Since version 2.2, you need to manually rely on okhttp kapt ‘com.github.liujingxing.r ...
Posted by mbbout on Thu, 16 Dec 2021 07:10:31 +0100
Android Getting Started tutorial | Audio
Parsing and encapsulating mp4 files using MediaExtractor and MediaMuxerbrief introductionMP4 or MPEG-4 Part 14 is a standard digital multimedia container format.The audio format in MP4 is usually AAC (audio / mp4a LATM)MediaExtractorMediaExtractor can be used to separate video tracks and audio tracks in multimedia containerssetDataSource() sets ...
Posted by pasychosheep on Wed, 15 Dec 2021 23:55:06 +0100
Android_ Realization of skin changing function
Android skin changing function is nothing new. There are many third-party skin changing libraries and implementation schemes on the market. The main reasons for choosing Tencent's QMUI library to demonstrate the skin changing function of APP are as follows: 1. The implementation process of skin changing function is simple and easy to understand ...
Posted by vickytam on Wed, 15 Dec 2021 21:06:37 +0100
Summary of Android animation effect and implementation of frame animation
preface
There are three simple and basic animation effects in Android, namely, Drawable Animation, View Animation and Property Animation. The following describes each animation and realizes the animation of Jingdong brother delivering express by using frame animation.
1, Frame animation
1.1 general
Frame animation is to play a group o ...
Posted by Miichael on Wed, 15 Dec 2021 15:24:54 +0100
Source code analysis of Android event distribution, as an Android Developer
Activity
There are two main methods related to event delivery in an Activity, dispatchTouchEvent() and onTouchEvent(). Event delivery starts with the dispatchTouchEvent() method of the Activity.
Event distribution
Event distribution method in Activity: dispatchtouchevent (), and its source code is as follows:
//Event distribution
publi ...
Posted by Bisdale on Wed, 15 Dec 2021 14:20:35 +0100
Android component-based actual combat, ant gold clothes push on all sides
(1) Distinguish between application and library
if (isApplicationModule1.toBoolean()){
apply plugin: 'com.android.application'
}else{
apply plugin: 'com.android.library'
}
(2) Add applicationId
defaultConfig {
if (isApplicationModule1.toBoolean()){
applicationId "com.demo.myapplication.module1"
...
Posted by -Mike- on Wed, 15 Dec 2021 10:45:20 +0100
Android source code analysis: Based on - Handler, byte beating is officially added
Source code analysis
Through the above simple code, we can realize the interception and monitoring of crash and ANR, but we may not know why, including we know that ANR occurs, but we need to further analyze where ANR occurs and how to solve it. The problems analyzed today are:
How to intercept global crash and avoid APP exit.How to realize A ...
Posted by Magneto on Wed, 15 Dec 2021 10:36:03 +0100