USB Preferences-Android13

USB Preferences 1. USB preference setting interface and entrance 2. USB function settings 2.1 USB function corresponding mode 2.2 Click Settings 2.3 Broadcast monitoring refresh 3. Log switch 3.1 Evet log 3.2 Log switch in code 3.3 Key logs 4. Abnormal 1. USB preference interface and entrance Settings>Connected devices>USB packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java packages/apps/Settings/res/xml/usb_details_fragment.xml private static List<UsbDetailsController> createControllerList(Context […]

[Data structure] Reflection, enumeration

?Author: Xiao Hu_Bu Muzhu Author’s homepage: Xiao Hu_Bumuzzled’s personal homepage Included column: A brief discussion of data structure Continue to update articles and follow bloggers to avoid detours. Thank you for your support Reflection, enumeration 1. Reflection 1.1 Definition 1.2 Reflection related classes 1.3 Reflection example 1.3.1 Three ways to obtain Class objects 1.3 Reflection […]

JVM source code analysis: processing details of soft, weak and virtual references

Table of Contents Write in front: Source code analysis: Java level: JVM level: Danger points of use: Summarize: Version Information: jdk version: jdk8u40 Garbage collector: Serial new/old Write in front: Different garbage collectors have different algorithms and different efficiencies. The default is ParallelScavenge new/old in JDK8. The author used Serial new/old when writing the article. […]

Use reflection to dynamically construct wrapper conditions (use reflection to obtain annotation values and entity class values)

Use reflection to dynamically construct wrapper conditions Entity class /** * api list query entity class * *@authorwys */ @Data public class SysApiQuery { private Long id; /** * api name */ @Query(type = QueryTypeEnum.EQUAL) private String apiName; /** * api path */ @Query(type = QueryTypeEnum.EQUAL) private String apiUrl; /** Starting time */ @JsonIgnore private […]

JAVA reflection mechanism implements methods of calling classes

NmsMonitorDrillController package com.nrxt.nms.mon.ms.controller; import com.nrxt.nms.mon.ms.service.impl.NmsMonitorDrillService; import com.nrxt.nms.mon.ms.utils.ByteArrayUtil; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Controller @RequestMapping(value = “/monitor/interface”) public class NmsMonitorDrillController { @Resource NmsMonitorDrillService nmsMonitorDrillService; private static final Logger logger = Logger.getLogger(NmsMonitorDrillController.class); @ResponseBody @RequestMapping(value = “/queryByDrillReceive”, method = RequestMethod.POST) public byte[] queryByDrillReceive(HttpServletRequest […]

Refactor Android asynchronous code using promises

Background Writing Android asynchronous tasks in business has always been a challenge. The previous callback and thread management methods were complex and cumbersome, making the code difficult to maintain and read. JavaScript actually faces the same problem in the front-end field, and Promise is one of its more mainstream solutions. Before trying to use Promise, […]

BindingFlags in C#: Core enumeration types for reflection

The C# programming language provides a very powerful feature: reflection, which allows us to dynamically obtain and operate type information at runtime. Reflection can be used to implement many advanced functions, such as dynamically loading assemblies, creating object instances, calling methods, accessing fields and properties, etc. To use reflection, we need to use some classes […]

(StateFlow & ShareFlow) VS (Flow & LiveData)

Table of Contents data flow General process Switch thread StateFlow & ShareFlow StateFlow Build StateFlow &ShareFlow In the previous articles on Flow, collect function analysis and imitation of Flow builder to create data flow articles, we explored the simple use of flow and its simple principles. However, during the production process, we often borrow these […]

Linux driver HC_SR04 distance sensor usage reference and simple notes

Foreword HC_SR04 This distance sensor interface is relatively simple. Simply implement a driver as a learning example. Driver file #include <linux/init.h> #include <linux/module.h> #include <linux/unistd.h> #include <linux/fs.h> #include <linux/cdev.h> #include <linux/gpio.h> #include <mach/platform.h> #include <linux/uaccess.h> #include <linux/device.h> #include <linux/sched.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/timer.h> #include <linux/wait.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/delay.h> #include <linux/sched.h> […]

Andriod Practical Project Development No. 14 – Tree Structure, How to Handle the Page Refresh Mechanism after Adding Nodes

Renderings public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); initData(); LinearLayoutManager manager = new LinearLayoutManager(mActivity); mTreeListRecy = view.findViewById(R.id.mTreeListRecy); if (mTreeListRecy != null) { mTreeListRecy.setLayoutManager(manager); mTreeListRecy.setAdapter(adapter); //Tree2HeaderView tree2HeaderView = new Tree2HeaderView(mActivity); treeHeaderView = new TreeHeaderView(mActivity,dataList); adapter.addHeaderView(treeHeaderView); //ArrayList<String> list = new ArrayList<>(); //for (int i = 0; i < 30; i + + ) […]