, the Activity management thread (AmS). Activity is a program fragment defined in Android, this segment can be understood as "programs that can be Dynamically Loaded". That is, when the application thread starts, different activities can be loaded based on user operations.
The third part is the Apk application client. The client of each Apk application is executed from the main () function in the ActivityThread class, which is identical to a common Ja
Android Application Startup Process
The topic of an app in Android is composed of ActivityThread. However, it involves many details, such as who created ActivityThread and at what time? What is the relationship between it and system service programs, such as ActivityManagerService and WindowManagerService? You need to know about these.
There are usually two ways to be started in the system
Click the corresponding application icon in Launcher to startMost of these startup methods are initiated
the process of ContentProvider is started, it will be started and published to AMS at the same time. Note that at this time, its onCreate must be first executed in the onCreate Application, this is a rare phenomenon among the four major components. The Start entry is the main method of ActivityThread. The main method creates an ActivityThread instance and a message queue of the main thread. In the attach method, the attachApplication method of
(Intent. ACTION_BATTERY_CHANGED); 4. intent. addFlags (Intent. FLAG_RECEIVER_REGISTERED_ONLY5.Pack up the values and broadcast them to everyone6.7 .}
1.7. Analysis of the broadcast registration process
1.7.1. Static registration process
When PackageManagerService starts up, it is responsible for initial PMS Scanning System directories one by one during startup to parse the apk file. Static broadcast receivers are handled by the way when PMS is doing this.
PMS will parse the manifest file of the
When PackageManagerService starts up, it is responsible for initial PMS Scanning System directories one by one during startup to parse the apk file. Static broadcast receivers are handled by the way when PMS is doing this.
PMS will parse the manifest file of the apk, find the handler registered here, and load it To the memory.
The sequence of PMS initialization scan directories:
System/framework
System/app
Vendor/app
Data/appd
Rm/app-private
We can see how PMS parses manifest during initializat
divided into system services and client services. A system service is a service that can be obtained through Getsystemservice (), a client service that refers to a custom service provided by an application.How do clients get binder objects?AMS provides the StartService () function to start the client service. For clients, you can use the following two functions to establish a connection to a service:i) public componentname startservice (Intent Intent
Create an app window one, create a Activity1. The application window must correspond to the ACTIVITY,AMS notification client Activitythread start activity. Reflection Create Activity ObjectSecond, create Window2. The Activity.attach () method sets the internal variable. 3. The Activity.attach () method creates a Window object. Policymanager.makenewwindow () Create (via Com.android.internal.policy.impl.Policy configuration) Create Phonewondow, assign t
Android Window 3: Create an application Window, androidwindow
Create application window 1. Create Activity1. the application window must correspond to the Activity. AMS notifies the client ActivityThread to start the Activity. Create Activity object through reflection
2. Create the Window2. activity. attach () method to set internal variables. 3. The activity. attach () method creates a Window object. PolicyManager. makeNewWindow () is created throu
Before we analyzed the process by which the Android6.0 system installed the application at startup, the Launcher application was responsible for displaying it on the desktop after the applications were installed.First, AMS start launcherThe launcher application is initiated directly by calling Starthomeactivitylocked in the Systemready method of AMS, the following is the code that Systemready starts launche
the binder (the Activitymanagerservice is referred to as AMS later), The results returned by this interface include the Thistime, TotalTime time printed above.
StartTime the point in time that the startactivityandwait () was just ready to be called
Endtime records the point in time that the startactivityandwait () function call returned
WaitTime = startactivityandwait () call time-consuming.
The calculation of Thistime and Total
the logic of UI access more complex22) lock mechanism reduces the efficiency of UI access because the lock mechanism blocks execution of certain threadsNO6:1) Consider using ThreadLocalWhen some data is scoped to a thread and different threads have different copies of the data. such as Looper, Activitythread, and AMs.2) threadlocal Another usage scenario is the transfer of objects under complex logic, such as listeners. Because parameter passing can
starting mainactivity.The result of the ADB shell am start-w packagename/mainactivity return is the standard application startup time (note that the phone before Android 5.0 is not WaitTime this value):
? adb shell am start -W com. Media. Painter/com. Media. Painter. Paintermainactivity
Starting:intent{ act=android.. Action. Maincat=[android.. Category. Launcher]cmp=com media./. Paintermainactivity}
Status: OK
Activity: com. Media. Painter/. Paintermaina
call Activitymanagerservice through the binder IPC, which is referred to as AMS. AMS does the following: it will eventually collect the intent object's pointing information through the Packagemanager Resolveintent () method (the middle will go through many classes, method calls). Verify that the user has sufficient permissions to invoke the target activity through the granturipermissionlocked () method,
a application Master, which, after ResourceManager allocates resources, runs in the container of a slave node, The task of doing things is also running in the container with a slave node. Rm,nm,am and even ordinary container communication between the RPC mechanism. Yarn Detailed Architecture Design
The following figure is a reference to some of the information I have drawn, please see:
Separately introduced, all lines are RPC protocol, client and admin are outside the yarn system, client is us
"] = "JFK",it["San Francisco"] = "SFO",it["Los Angeles"] = "LAX".}.What does this passage mean? Explain the first half of the section.Airports is the object name, which is the object array name, an association from is the keyword, the string after the from is the type of the array key, and the string after to is the array that the array is a string type.To increase your perceptual knowledge, give another example:Products are an association fromInteger
"Eventually Consistent" (released onACM Queue). If youFinal consistency"Not very clear. Please read this article.
Brewer'sCAP Theory(The basis of scalability) can be found here. You can also take a look at the original Brewer slides on PODC 2000.
A slide at the NoSQL Conference on SFO on March 13, June 2009. These materials can be described as classic, key, and memorable.
SQL Databases Don't Scale is a short, basic, and straight cut article. Unles
consistent of Werner vogels (released in ACM Queue ). If you are not very clear about the final consistency, read this article.
Brewer's cap theory (the basis of scalability) can be well interpreted here. You can also take a look at the original Brewer slides on podc 2000.
A slide at the nosql Conference on SFO on March 13, June 2009. These materials can be described as classic, key, and memorable.
SQL databases don't scale is a short, basic, and str
For the administrator of a website, it is necessary to record the IP address of the visitor. By recording the visitor's IP address, the website's access statistics, distribution of visitor source regions, and tracking of illegal visitors provide important information.Before developing a program, we must master several key points.1. Obtain the client IP address statement: Request. ServerVariables ("remote_addr ");2. Write Cookies in ASP statements: Response. Cookies ("cooki
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.