A brief description of the APP startup process

1. Process overview
write picture description here
Start process:

①Click the desktop App icon, the Launcher process uses Binder IPC to initiate a startActivity request to the system_server process;

②After the system_server process receives the request, it sends a request to create a process to the zygote process;

③ The Zygote process forks a new child process, that is, the App process;

④ The App process initiates an attachApplication request to the sytem_server process through the Binder IPC;

⑤After receiving the request, the system_server process performs a series of preparations, and then sends the scheduleLaunchActivity request to the App process through the binder IPC;

⑥ The binder thread (ApplicationThread) of the App process sends a LAUNCH_ACTIVITY message to the main thread through the handler after receiving the request;

⑦ After receiving the Message, the main thread creates the target Activity through the emission mechanism, and calls back methods such as Activity.onCreate().

⑧ At this point, the App is officially launched, and it begins to enter the Activity life cycle. After executing the onCreate/onStart/onResume methods, you can see the main interface of the App after the UI rendering is completed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325898413&siteId=291194637