1. Eclipse compiles. Java source files into a. class
2. Use the DX tool to convert all. class files to. dex Files
3. Package the. dex file and all resources into an. apk file
4. Install the. apk file to the virtual machine Completion program installation
5. Start the Program – Open the process – turn on the main thread
6. Create Activity Object – Execute OnCreate () method
7, according to the Main.xml file initialization interface
Application Startup:
First, parse the manifest file and load
Application startup needs to start with Packagemanagerservice, since the application is Packagemanager managed, you can simply assume that Packagemanagerservice is doing some preparatory work for the application to start, To open the application.
1, Packagemanagerservice (data) read the Mainfest information of all applications, and establish a repository stored in system-level shared memory
1) Analysis:
Packagemanagerservice after launch, will parse the work, it will focus on monitoring some files: system/framework, System/app, Data/app, data/app_private Once the data is stored in these files, it will parse
2) Permission assignment:
Packagemanagerservice will establish a mapping between the underlying UserIDs and groupids with the upper permissions, assigning permissions to some underlying users,
Permissions are mapped, UID, and GroupID, and the appropriate permissions are assigned
3) Save the data:
Packagemanagerservice Another important operation is to save the parsed apk information to the Packages.xml and packages.list files,
The following data is recorded in Packages.list: Pkgname,userid,debugflag,datapath (Packet data path)
"Next time you boot, you won't be scanning each apk, just read the Packages.xml and packages.list files."
In addition to these two major jobs, there are other operations, such as testing files, etc.
2, Launcher will Packagemanagerservice has been parsed and processed data are loaded into memory, from memory to obtain the corresponding data,
and displayed on the mobile phone "The reason can be displayed on the mobile phone desktop, is because in the manifest file is configured with the following content:"
<action android:name= "Android.intent.action.MAIN"/>: Portal of the application
<category android:name= "Android.intent.category.LAUNCHER"/>: This property is configured to be displayed in the list
Click on the icon and the app will be opened up:
Android project start-up process