How you ever wonder how all your app detects OS events like when the internet is turned ON, the incoming call is coming, battery low etc. like that?
Yes, it is because of Android OS build in Event, "Broadcast Receiver."
Whenever an OS event happens, we can register some event.
For example, Truecaller detects whenever an incoming call comes, we can get the number and check the number with the server and get the name of that contact!
and
All the app detects internet turned on the event and checking for new messages!
This is what is "Broadcast Receiver"