Why does the android need a broadcast receiver object, if the processing of action from implicit intents can be done in the service or on the activity?

  • I read there it is written only about the fact that you can create Receiver through the manifest or programmatically - evgeniy.se
  • Broadcast will react to the event even if the activation or service is not running and through it the activation / service starts - pavlofff

1 answer 1

Services : should be used if you want something to work in the background, even if the application is closed. You can create a service in a separate process, and if you want, you can transfer your service to another application. Downloading any content or playing music is a good example.

Broadcast messages : used when you want to perform some action during an event. For example, when loading a device: if you want to do something when the device boots, for example, change the date and time, a Broadcast manager .

! Also, their difference lies in the fact that services can perform a long (conditionally unlimited in time) background task, and receivers of broadcast messages work for a short period of time, only to handle the event.