HashMap Implementation Principle Learning
HashMap source from: android-25/java/util/HashMap
1. Construction methods
static final int MAXIMUM_CAPACITY = 1 << 30;
static final int DEFAULT_INITIAL_CAPACITY = 4;
static final float DEFAULT_LOAD_FACTOR = 0.75f;
public HashMap() {
this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
}
// The default parameter is 4,0.75f
public Hash ...
Added by phpforever on Wed, 27 Nov 2019 05:01:40 +0200
Android uses local service and remote service
Use local service
I. define java interface
public interface CalculateI {
int addab(int a, int b);
}
Create a Binder subclass, inherit Binder and implement interface methods
public class CalculateBinder extends Binder implements CalculateI{
@Override
public int addab(int a, int b) {
return a+b;
}
}
III. Onbind in ...
Added by mrdave on Tue, 26 Nov 2019 19:30:44 +0200
Kotlin Core Syntax: Introduction to kotlin, Type System
Kotlin is a static language that runs on Java virtual machines, Android s, and browsers. It is 100% compatible with JAVA. If you are familiar with Java, you will find that Kotlin still uses the classic JAVA collection framework, in addition to its own standard libraries.
Introduction to kotlin
First try the Kotlin code.The Book class contains t ...
Added by NeilB on Mon, 25 Nov 2019 05:33:10 +0200
android adjustNothing get keyboard height
The implementation effect is as follows: after obtaining the keyboard height, manually move the input box:
20190402144716388.gif
Although the pop-up of the input box is not smooth enough, it seems a little stiff, but we can add appropriate animation to improve it.
The method is to cover a PopupWindow with a width of 0 and a ...
Added by ifuschini on Sun, 24 Nov 2019 18:43:40 +0200
Brief introduction of HandlerThread usage scenario and source code analysis
public class HandlerThread extends Thread {
int mPriority;
int mTid = -1;
Looper mLooper;
private @Nullable Handler mHandler;
public HandlerThread(String name) {
super(name);
mPriority = Process.THREAD_PRIORITY_DEFAULT;
}
/**
* Constructs a HandlerThread.
* @param name
...
Added by thumrith on Sat, 23 Nov 2019 22:05:16 +0200
Too tired to brush, teach you to use Python to crawl down all the beautiful ladies and sisters and watch them slowly
Preface
Text and pictures of the text come from the network for learning and communication purposes only. They do not have any commercial use. Copyright is owned by the original author. If you have any questions, please contact us in time for processing.
Author: Star Ango, AirPython
Target Scene
I believe that when you brush short video with sh ...
Added by pourmeanother on Sat, 23 Nov 2019 11:11:17 +0200
Android MVVM upgrade DataBinding+Retrofit+RxJava+ViewModel+LiveData
This article mainly uses the generic optimization project structure to explain the key modifications. If you don't understand the project structure, please see my last two Blogs:
Android MVVM improved DataBinding+Retrofit+RxJava+ViewModel+LiveData (2)
Android MVVM Basic Edition DataBinding+Retrofit+RxJava (1)
I. modify BaseA ...
Added by ramrod737 on Fri, 22 Nov 2019 19:58:57 +0200
Add dynamic parameters to vue wechat sharing link
When sharing wechat, the carrying parameters of sharing link may not be fixed. You need to know that this is the basic code for dynamically setting sharing link before sharing, which is not so detailed, but the general process is as follows
1. Install and reference jssdk
npm install --save weixin-js-sdk
const wx=require('weixin-js-sdk')
...
Added by Dilb on Thu, 21 Nov 2019 16:23:22 +0200
Android Jetpack architecture component - Lifecycle in pit Guide
This article starts with WeChat public's "Android development tour". Welcome to pay more attention to get more dry goods.
Background introduction
In the previous article, we mainly introduced the origin of Jetpack and the component library contained in each of the four components. In this article, we will learn about lifecycle compone ...
Added by st89 on Wed, 20 Nov 2019 11:21:31 +0200
Android app auto update summary (adapted to 9.0)
1. configuration:
1.1 add permissions and FileProvider in Android manifest.xml:
--------------------------------------------------------------------------------------------------------------------
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EX ...
Added by 2levelsabove on Tue, 19 Nov 2019 20:30:55 +0200