Sending broadcasts

You will use the LocalBroadcastManager to send the notification to the user when the alarm sets off.  This tip from the documentation is why it is better to use this method of broadcasting:

"If you don't need to send broadcasts across apps, use local broadcasts. The implementation is much more efficient (no interprocess communication needed) and you don't need to worry about any security issues related to other apps being able to receive or send your broadcasts."

And, this tells us why it is efficient:
Local Broadcasts can be used as a general purpose pub/sub event bus in your app without any overheads of system wide broadcasts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset