Today's top screen adaptation
Today's top screen adaptation
In a word, summarize the principle of realization:
According to the width of the design drawing, calculate the density, then calculate the dpi, and replace the dpi in the system. Then the layout file can set the width according to the design drawing given by the UI, so as to achieve the purpose o ...
Added by NeoPuma on Thu, 02 Jan 2020 16:39:57 +0200
Java parses Android manifest file to obtain package name entry point permission and other information
Java parses the Android manifest file tool class. Input the XML file path to get the APK package name, entry Activity, all permission lists and Activity lists.
Function Description:
xmlHandle()
XML parsing entry method, parsing permission and activity list
findPackage()
Resolve package name information
findLau ...
Added by IceHawk on Thu, 02 Jan 2020 14:30:36 +0200
Android notes: Android devices get public IP
Today, I have a friend who wants to get the current ip of Android phone connected to the network and ask me how to do it. I think it's not easy. Tell him to judge the network environment first. If WiFi can be obtained through WiFi manager, if it is traffic (2G, 3G or 4G network), get getHostAddress() through NetworkInterface tr ...
Added by jossejf on Wed, 01 Jan 2020 20:06:40 +0200
android uri to bitmap image and compress
Many people will use Media.getBitmap in onActivityResult to get the returned pictures when they call the gallery to select pictures, as follows:
Uri mImageCaptureUri = data.getData();
Bitmap photoBmp = null;
if (mImageCaptureUri != null) {
photoBmp = MediaStore.Images.Media.getBitmap(ac.getContentResolver(), mImageCaptureU ...
Added by exploo on Wed, 01 Jan 2020 05:53:07 +0200
Using LiveData to handle events
Today, a strange thing happened. An Activity(A) was created after it was closed on the colleague's mobile phone. After debugging, it was found that every time the Activity(A) was closed, the life cycle of the previous Activity(B) would be triggered. Then the subscribed LiveData object would receive the OnChange message to creat ...
Added by konetch on Sun, 29 Dec 2019 21:52:12 +0200
Download in webview using AsyncTask download (8.0 compatible)
Download in webview using AsyncTask download (8.0 compatible)
Write a class to inherit Asynctask, and download its file with Httpconnection in doinbackground.
Postexecute is to open the download file (apk) after the download is completed
private class DownloadTask extends AsyncTask<String, Void, Void> {
// Pass tw ...
Added by cjbeck71081 on Sun, 29 Dec 2019 21:32:32 +0200
What does T && (double ampersand) mean in C ++ 11?
I've been working on some new features of C++ 11, and one of the things I noticed is the use of the double ampersand when declaring variables such as T&var.
First of all, what is the name of this beast?I want Google to allow us to search for punctuation like this.
What does this mean?
At first glance, it may seem like a double ref ...
Added by Hamlets666 on Sun, 29 Dec 2019 07:49:50 +0200
uni-app: How do I implement incremental updates?
As you know, many APPs have incremental updates. Uni APP also introduced incremental updates at the beginning of this year. Today we will learn about them.
Of course, many app markets, especially apple, reject incremental updates in order to prevent developers from providing illegal content to users without market review and approval.So with in ...
Added by gm04030276 on Thu, 26 Dec 2019 05:49:49 +0200
js method encapsulation commonly used in development
1. Determine whether it is an array
function isArray(arr){
return Object.prototype.toString.call(arr) ==='[object Array]';
}
isArray([1,2,3]) //true
2. Judge whether it is a function (three kinds)
function isFunction(fn) {
return Object.prototype.toString.call(fn) ==='[object Function]';
return fn.constructor == ...
Added by chomps on Tue, 24 Dec 2019 20:44:35 +0200
Spring Security SMS verification code login in Spring Boot
In the section of adding graphic verification code in Spring Security, we have implemented the account password login based on Spring Boot + Spring Security, and integrated the function of graphic verification code. At present, another very common way of website login is SMS authentication code login, but Spring Security only provides the login ...
Added by Thoughtless on Tue, 24 Dec 2019 06:00:15 +0200