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"
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
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
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
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
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
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
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
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
This week's Android learning summary
activity life cycle
test: Write the following code in MainActivity.java
public class MainActivity extends AppCompatActivity {
private static final String TAG = "life_cycle";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
s ...
Posted by gamerzfuse on Sat, 14 May 2022 09:20:05 +0300