Android-helloworld InterpretationAn introduction to Android boot process
The general process is: Zygote daemon->VM Virtual machine--app app (no main function)
1 Packagemanageservice class identification manifest file
2 manifest file to find the main activity class, and then load the activity,
3 Starting the OnCreate method in the main activity
4 Call Setcontentview in OnCreate to bind the layout interface
Two Eclipse launch Android program process
Compile Classes.dex file, package apk file, start Select Device (real machine or virtual machine), upload apk file, install apk file, start the main activity
Three logs
1 log is an important file for system-generated logs to analyze issues
View Log by priority, program error, see red Log
Log Category:
Verbose (V) verbose mode
Debug (D) Debugging mode
Info (I) information mode, Normal mode
Warn (W) warning mode
Error (E) mode
2 when log is generated:
Program abnormal exit, uncaused exception
Program forcibly closed, force close abbreviation (FC)
Program not responding, application no Response abbreviation (ANR)
When does ANR occur?
Interface operation waits for more than 5 seconds of response time
The Handlemessage callback function executes for more than 10 seconds
3 log-generated location and search
Data/log in the root directory
Find analytic log file General search keywords fatal
4 Log file format
System basic information, including memory, CPU, process queue, virtual memory, garbage collection, etc.
MEMORY INFO (/proc/meminfo)
CPU INFO
Procrank
VIRTUAL MEMORY STATS (/proc/vmstat)
Vmalloc INFO (/proc/vmallocinfo)
Event information, which is also the main information we analyze
Vmalloc INFO (/proc/vmallocinfo)
EVENT info (/proc/vmalloc info)
Virtual machine information, including processes, threads, processes and threads that can be traced
VM traces JUST now (/data/anr/traces.txt)
5 two modes of mobile phone factory
Development developer mode (with root privileges)
User mode (does not contain root)
Android-helloworld interpretation