Regular Intents vs Broadcast Intents

Things are happening all the time on an Android device. WiFi is going in and out of range, packages are getting installed, and phone calls and text messages are coming and going.

There may be many components on the system that need to be aware of these kinds of events so that they can react accordingly. To notify these components, Android uses a broadcast intent to tell everyone about it.

These kinds of broadcasts, which are sent from the system, are referred to as system broadcasts, but you can also send and receive your own custom broadcasts. The mechanism for receiving both system and custom broadcasts is identical, but you will only be working with custom broadcasts in this chapter.

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.