One, application (single global Only one, life cycle equivalent to the life cycle of the app)
1. Initializing global object, environment variable configuration (onCreate)
2. Get the current memory usage of the application (memory optimized)
Onlowmemory: Callback when memory is low
Ontrimmemory: Resource release based on memory usage
3. Monitor the lifecycle of all activity within the application (Activitylifecyclecallback)
4. Monitoring application configuration information Change (onconfigurationchanged)
Second, cold start (no process to have process) time calculation
Starting point: OnCreate method of Application
End point: Home activity OnCreate Method loading complete
Three, cold START process
Application constructor Method--attachbasecontext--oncreate--activity construction method--oncreate--The background of the configuration body and other properties--onstart--onresume--measurement layout drawing is displayed on the interface
Four, cold start optimization
Reduced OnCreate method Effort (lazy loading, reload when used)
Do not let application participate in business operations
Do not take a time-consuming operation in application
Do not save data in application as a static variable (memory leak, data security)
Layout/mainthread
Android performance optimization-Cold start optimization (application)