Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What is the use of android : exported in broadcastreceiver-stack?


Asked by Lia Vazquez on Nov 30, 2021 Android



From the Developer Guide: android:exported Whether or not the broadcast receiver can receive messages from sources outside its application — "true" if it can, and "false" if not. If "false", the only messages the broadcast receiver can receive are those sent by components of the same application or applications with the same user ID.
One may also ask,
Broadcast in android is the system-wide events that can occur when the device starts, when a message is received on the device or when incoming calls are received, or when a device goes to airplane mode, etc. Broadcast Receivers are used to respond to these system-wide events.
In this manner, Broadcast Receivers simply respond to broadcast messages from other applications or from the system itself. These messages are sometime called events or intents.
In respect to this,
What exactly the use of android:exported="true" to register broadcast receiver in Android ? Thanks in advance. android:exported Whether or not the broadcast receiver can receive messages from sources outside its application — "true" if it can, and "false" if not.
Subsequently,
Context-registered receivers Android apps can send or receive broadcast messages from the Android system and other Android apps, similar to the publish-subscribe design pattern. These broadcasts are sent when an event of interest occurs.