How the Android system is started, and how the application is started. The following is a brief overview of the initialization process.
Initialization of the 1.Android system
The 1.1Android system will start the Linux base system first, then boot the Linux kernel and start the initialization process init
Linux Kernel---->init (pid=1)
1.2 Start Daemon daemons
Start the USB daemon and manage the USB connection
Start Android Debug Bridge Daemon management adb connection
Start the Debuggerd Debug daemon
To start the wireless interface daemon to manage wireless communication
1.3 The zygote process starts while the daemon is started
To create an initialization Dalvik initialization instance
Load the required classes and listeners for the socket request
Create a virtual machine instance to manage the application's processes
| Daemons
init----
| Zygote
1.4 Next, initialize the runtime process
Initialize Service Manager
Registers the service manager with it as the default binder for the service context Manager
1.5 Starting the system service
Runtime sends a request to zygote, Zygote creates a Dalvik virtual machine instance for the system service, and starts the system service, the system service starts the native system service, mainly including audio Flinger and surface Flinger, These local system services are registered to Service Manager. The system service starts the Android Management service and registers the management service with the service Manager.
1.6 System loading complete, waiting for application to start
The 1.7Activity Manager manager sends a socket request to zygote, Zygote creates a Dalvik virtual machine process through the fork mechanism to run the application
All application processes are child processes of the zygote process, one for each application, and one for the virtual machine.