![2011042818580676.png](https://i-blog.csdnimg.cn/blog_migrate/1ea8a52204fe5e054433257e4ba85b1f.png)
![2011042818584472.png](https://i-blog.csdnimg.cn/blog_migrate/bc7675b4a969aed87a221d1ee3240afb.png)
![2011042818591210.png](https://i-blog.csdnimg.cn/blog_migrate/b6beab0ac433c6af21192049de4cb1be.png)
![2011042909182581.png](https://i-blog.csdnimg.cn/blog_migrate/e5ff6c41f723b2d109ea3e4d8d2a4189.png)
- Activity
- Intent
- Service
- Content Provier
![2011042818593630.png](https://i-blog.csdnimg.cn/blog_migrate/91161c14070538b06c5bd7b888711216.png)
Activity
is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.(官方文档的定义)
Intent
object, is a passive data structure holding an abstract description of an operation to be performed — or, often in the case of broadcasts, a description of something that has happened and is being announced. There are separate mechanisms for delivering intents to each type of component:(官方文档的定义)
A Service
is an application component that can perform long-running operations in the background and does not provide a user interface. Another application component can start a service and it will continue to run in the background even if the user switches to another application. Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service might handle network transactions, play music, perform file I/O, or interact with a content provider, all from the background.
A service can essentially take two forms:
-
Started
-
A service is "started" when an application component (such as an activity) starts it by calling
startService()
. Once started, a service can run in the background indefinitely, even if the component that started it is destroyed. Usually, a started service performs a single operation and does not return a result to the caller. For example, it might download or upload a file over the network. When the operation is done, the service should stop itself.
Bound
-
A service is "bound" when an application component binds to it by calling
bindService()
. A bound service offers a client-server interface that allows components to interact with the service, send requests, get results, and even do so across processes with interprocess communication (IPC). A bound service runs only as long as another application component is bound to it. Multiple components can bind to the service at once, but when all of them unbind, the service is destroyed. - (官方文档的定义)