Android-helloworld interpretation

Source: Internet
Author: User

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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.