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

Study Notes - Week 3

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

Project training - AI based intelligent video clipper displays video frames and cuts videos

preface For each video clip returned from the back end, the front end needs to ensure that the user can cut and fine tune it. The specific implementation effects are as follows: Here, the whole process can be disassembled into the following steps: Acquisition and display of all video framesImplementation of video sliding marquee RangeS ...

Posted by melrse on Fri, 13 May 2022 00:59:09 +0300

Learning notes ----- Android integrates Gaode map to obtain the current city location (no map is displayed)

Recently, there is a function to locate the current city in the project. At the beginning, I chose to use Baidu map api to develop this function. However, according to the code written in the development document provided by Baidu map, the obtained city location is null every time I run. Strangely, I can get the longitude and latitude of the cu ...

Posted by karassik on Tue, 10 May 2022 10:10:59 +0300