[Android advanced] Kotlin condition control
IF expressionAn if statement contains a Boolean expression and one or more statements.// Traditional Use
var max = a
if (a < b) max = b
// Use else
var max: Int
if (a > b) {
max = a
} else {
max = b
}
// As an expression
val max = if (a > b) a else bWe can also assign the result of the IF expression to a variable.val max ...
Posted by hagman on Tue, 18 Jan 2022 06:55:19 +0100
Can you make APP never collapse - a duel between Xiaoguang and me
prefaceAs for intercepting exceptions, you must know that you can use thread Setdefaultuncaughtexceptionhandler to intercept exceptions in the App and then handle them.So I had an immature idea...Let my APP never collapseSince we can intercept crashes, we can directly intercept all exceptions in the APP without killing the program. Such an APP ...
Posted by kade119 on Tue, 18 Jan 2022 03:44:47 +0100
Android web notes: Retrofit
You need to add the necessary dependent libraries in the project first. Edit app / build Gradle file, add the following contents to the dependencies closure:
dependencies {
...
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
}
Use examples 1. Add an entity class ...
Posted by egalp on Mon, 17 Jan 2022 21:18:38 +0100
[Android] zero base to soaring | TouchListener PK OnTouchEvent + multi touch
3.4 TouchListener PK OnTouchEvent + multi touch
classification Android basics tutorial
Introduction to this section:
For example, this section brings you the comparison between TouchListener and OnTouchEvent, as well as the knowledge points of multi touch! TouchListener is based on listening, while OnTouchEvent ...
Posted by yakoup46 on Mon, 17 Jan 2022 18:25:44 +0100
WebView | network request method | HttpURLConnection | OkHttp | with instance based on Android
WebView
brief introduction
It is generally used to load some network interfacesAndroid is a high-performance browser with built-in webkit kernel, and WebView is a control encapsulated on this basis. WebView can be simply regarded as a browser control that can be nested on the interface!
method
WebChromeClient
Assist WebView in handling Ja ...
Posted by metalenchantment on Mon, 17 Jan 2022 13:44:54 +0100
Android HandlerThread source code analysis
preface
If we want to execute multiple time-consuming tasks, the first thing we think of is to create multiple threads to execute tasks. If we have learned thread pool, we can also use thread pool. Is there anything lighter than thread pool? Handler, find out~
what! Can the Handler also perform time-consuming tasks? Then the problem comes
...
Posted by jolinar on Mon, 17 Jan 2022 07:50:47 +0100
CoordinatorLayout/AppbarLayout/CollapsingToolbarLayout, Toolbar effects
The above special effect is the effect of Toolbar combined with CoordinatorLayout/AppbarLayout/CollapsingToolbarLayout; Using these views alone has no effect. Generally, they need to cooperate with each other.
brief introduction
CoordinatorLayout: Coordinator means coordinator after translation. It is mainly used to coordinate how the sub ...
Posted by micaudwell on Mon, 17 Jan 2022 05:39:38 +0100
Based on hongsoft face recognition, vip welcome system is developed and implemented
Application scenario:
The marked face information is recognized through hongruan sdk, and the recognized results are sent to android client to notify business personnel, so as to obtain customer information at the first time. Welcome system, Shangchao special personnel notification system, etc. can be used The effects are as follows:
F ...
Posted by Zhadus on Mon, 17 Jan 2022 04:53:14 +0100
Android8. 1 Hal layer development
This article is based on Android 8 1 source code. Here is a simple writing method and call of HAL. I will write an app interface that directly calls HAL, and the HAL layer code will directly read and write the driven node.
brief introduction
A new element of Android O is Project Treble. This is a major change in the a ...
Posted by Ty44ler on Mon, 17 Jan 2022 03:46:02 +0100
WMSWindowManagerService of Android 11.0 source code series
Main codes involved in this chapter:
frameworks\base\services\core\java\com\android\server\SystemServer.java
frameworks\base\services\core\java\com\android\server\wm\WindowManagerService.java
frameworks\base\services\core\java\com\android\server\wm\WindowAnimator.java
frameworks\base\services\core\java\com\android\server\AnimationThread.jav ...
Posted by errorCode30 on Mon, 17 Jan 2022 03:07:56 +0100