Activity appears to be an application's eye, providing a window of interaction with the user.
Broadcastreceiver seemed to be ears, receiving intent from all sides.
The service is running in the background.
A service is a section of a life cycle, without a user-interface program. A good example of this is the one that is being played from the playlist
The media player that plays the song. In a media player application, there should be multiple activity, allowing the user to select songs and play
Songs. However, there is no activity associated with the music replay function, as users will of course think that music should be used when navigating to other screens
It's still playing. In this example, the Media Player activity uses context.startservice () to start a service, which
You can keep your music playing in the background. At the same time, the system will keep the service running until the end of the service run. Other than that
We can also connect to a service by using the Context.bindservice () method (if the service is not running it will start
IT). When connected to a service, we can also communicate with it by the interface provided by the service. Take the Media Player example, we can also pause, replay and other operations
ContentProvider provides a way to access other application databases or other data.
The role of Android's four components and the role of Android service