Android Application main components
This address: Http://blog.csdn.net/caroline_wendy
Android Apps consist of 5 main components: Activities, intentions (intent), services (service), broadcast receivers (broadcast receiver), content providers (contents Provider);
1. Activities (activity)like a Web page, an activity is the appearance part of the application, the cost of initiating the activity: Creating a Linux process, allocating memory for the UI, populating the layout, setting the interface; Activity Manager is responsible for the creation, destruction, and management of activities, and automatically handles memory. boot status: Boot not into memory;Operating Status: Keep Focus;paused state: Not keeping focus, clearly visible;Stop state: The activity is not visible, in memory;destroy state: not in memory;when the stopped activity is destroyed, it is not destroyed and the data is kept as far as possible at OnStop (), rather than OnDestroy (). activity,fragment all belong to the category of activities.
2. Intention (Intent)a jump link similar to a Web page, divided into display and implicit .
3. Services (Service)The service runs in the background without any user interface. Only start, run, destroy three states,launch, OnCreate () +onstart (), Run, OnDestroy (), destroyed;a time-consuming operation requires a separate thread to be started.
4. Content provider (contents Provider) CRUD (create,read,update,delete) principle ,the contact provider (Contacts Provider), the settings provider (Settings Provider), and the media store are all followed by this principle;can be the data storage and user interface separation, easy to replace the program;
5. Broadcast receiver (broadcast receiver)Android Full system Publish/subscribe mechanism . For example, the update service, intent, broadcast receiver, radio intent, alarm.
Android-android Application Main Components