Custom annotation

One case: Custom ButterKnife implements findViewById and onClick events of the next View with annotations. Custom annotations are generally divided into two steps: the first step is to declare annotations and the second step is to parse annotations. 1. User defined annotation import java.lang.annotation.ElementType; import java.lang.annotati ...

Posted by thessoro on Mon, 16 May 2022 17:14:48 +0300

Android upload and download file progress monitoring, large file upload (within 500M)

1. Ordinary files are uploaded and downloaded in the form of retrofit+rxjava; 1.1 dependence implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:adapter-rxjava:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation 'io.reactivex:rxandroid:1.2.1' 1.2 retrofi ...

Posted by alan007 on Sun, 15 May 2022 23:45:24 +0300

Android ultra simple integration of living detection technology to quickly identify "fake face"

Android ultra simple integration of living detection technology to quickly identify "fake face" preface Have you ever had such concerns? Is it really safe to brush your face and unlock it? If someone impersonates me with my photos or videos, can the mobile phone find that I am not in front of the camera? Of course. Huawei HMS ML Kit i ...

Posted by wesmont on Sun, 15 May 2022 15:42:29 +0300

Android foundation - Network Technology

1, Request network using HttpURLConnection HttpURLConnection use First, you need to get the instance of HttpURLConnection. Generally, you only need to create a URL object, pass in the network address of the target, and then call the following openConnection() method. As follows: val url = URL("https://www.baidu.com.com "); / / pass in a ta ...

Posted by NikkiLoveGod on Sun, 15 May 2022 14:55:05 +0300

The most complete angle standard adaptation method for Android Applications

0 public method There are many common codes in the following implementation codes. We extract some common methods. The codes are as follows: 1. private static String getLauncherClassName(Context context) { 2. ComponentName launchComponent = getLauncherComponentName(context); 3. if (launchComponent == null) { ...

Posted by eliezer on Sun, 15 May 2022 13:16:51 +0300

Android text ads, custom vertical scroll switching TextView

The homepage of many app s will have a banner for displaying hot messages, which dynamically displays messages by vertically switching text. Vertical switching can effectively use the space to display more content, and the dynamic effect can attract the attention of users. I can think of two ways to achieve this effect: 1. Inherit a LineLay ...

Posted by Tux-e-do on Sun, 15 May 2022 08:48:17 +0300

Path's Bezier Curve

1. Path common method table For compatibility (lazy), the methods that were added after API 21 (ie, Android version 5.0) have been removed from this table. I can't help but complain, why it seems that some overloaded methods that can be written easily have to wait until API21 is added. The baby's heart is broken at the moment. effect R ...

Posted by mostwantedunm on Sun, 15 May 2022 06:59:43 +0300

Network operations in Android (HttpURLConnection)

segmentfault's support for mackdown syntax is not very good, some pictures can't be displayed, you can go to my nuggets to check This article. 1. Introduction to Android network knowledge The most important module of the Android program is the network part. How to download data from the network and how to upload the processed data to the networ ...

Posted by jamesxg1 on Sun, 15 May 2022 06:18:56 +0300

Singleton design pattern - Enumeration singleton - singleton optimization

preface Singleton mode is the simplest of Java design modes. You only need one class to implement singleton mode. However, you can't underestimate singleton mode. Although it is relatively simple in design, you will encounter many pits in implementation. Therefore, fasten your safety belt and get on the bus. Definition of singleton mode Sing ...

Posted by RestlessThoughts on Sat, 14 May 2022 16:23:00 +0300

FFmpeg old video coding and new video flow

Call process of old video coding (1)API registration Only the interface of libavcodec part is used, so avcodec can be used when registering to use FFmpeg interface_ register_ All to register avcodec_register_all(); (2) Find encoder After the registration operation is completed, you first need to find the encoder you use. You can use the i ...

Posted by dannydefreak on Sat, 14 May 2022 13:06:19 +0300