Prototype pattern of Java design pattern

Definition Use prototype instances to specify the kind of objects to create, and create new objects by copying these prototypes. The copied instance is the "prototype", which is customizable. Prototype pattern in Android source code 1. Intent Characteristic Advantage (1) Prototype mod ...

Posted on Sun, 16 Feb 2020 23:58:24 -0800 by andrewpike2000

Event handling of servicemanager

stay Start process of servicemanager In, you can see that servicemanager will enter the binder_loop() to start processing events after all preparations are ready. This note focuses on how to handle these core events. Command resolution: bind_parse() First of all, the command should be parsed and diffe ...

Posted on Sun, 16 Feb 2020 03:26:51 -0800 by m5638829

Differences between Android ScrollBy and ScrollTo

First of all, the conclusion comes from "Android development art exploration" ScrollBy actually calls the ScrollTo method, which implements relative sliding based on the current position, while ScrollTo implements absolute sliding based on the passed parameters. The so-called movement is the movement of the current ...

Posted on Sat, 15 Feb 2020 11:09:06 -0800 by jburfield

Some problems of parsing FileProvider QQUri under Android x

  1. Due to the Android version update, there is a library testing that Android X has abandoned v4, v7 and other versions Try one of the v4 packages of FileProvider that Android 7 started to use But after the Android 10 is adapted, the Android x library will be used instead androidx.core.content. ...

Posted on Sat, 15 Feb 2020 06:07:21 -0800 by matt_wood87

Getting started with Android: Toast, Menu usage and destruction of activities

Last: Getting started with Android (3): Basic usage of activities Toast In the previous article onCreate() added some code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.first_layout); Button button1 = (Button) fin ...

Posted on Fri, 14 Feb 2020 20:55:43 -0800 by deathrider

Using Fragment and RadioGroup for page layout switching in Android

Now the main page interface design of APP uses several buttons and different fragments to switch pages. It looks very clear to users at a glance. Here we use fragments and RadioGroup to switch pages. The interface design is as follows: The code is as follows: titlebar.xml(Titlebar Title bar) <?xml version="1.0" encodin ...

Posted on Fri, 14 Feb 2020 08:30:17 -0800 by palpie

Fingerprint identification process of Biometric biometric on Android Q

Part I: Fingerprint HIDL On devices with fingerprint sensors, users can register one or more fingerprints and use them to unlock devices and perform other tasks. Android uses Fingerprint HIDL (hardware interface definition language) to connect to vendor specific libraries and fingerprint hardware (s ...

Posted on Fri, 14 Feb 2020 03:29:22 -0800 by DaiLaughing

Activity managerservice the second lecture: Service startup process

1, Service startup process When we start a Service, we usually call the startService() method or bindService() method. Let's take a look at the flow of these two methods. 1.startService We will first call the startservice () method in Activity. You can see that there is no implementation of the start ...

Posted on Fri, 14 Feb 2020 01:45:24 -0800 by Spikey

How to add an option menu to a clip on Android

I'm trying to add an item to the options menu from a set of clips. I created a new MenuFragment class and extended it to the fragment I want to include the menu item in. This is the code: public class MenuFragment extends Fragment { MenuItem fav; @Override public void onCreate(Bundle savedInstanceState) { super.onCre ...

Posted on Thu, 13 Feb 2020 08:21:11 -0800 by horseygirl

HandlerThread features and source code analysis

HandlerThread generation background Usually we start Thread sub Thread for time-consuming operation, and it is very expensive to create and destroy threads many times. HandlerThread gives us the possibility to execute multiple time-consuming operations serially in the same Thread What is HandlerThread Handler+Thread+Looper i ...

Posted on Thu, 13 Feb 2020 08:12:11 -0800 by Thora_Fan