Local Broadcast, less overhead and secure in Android
Broadcast receiver is an Android component which allows you to send or receive Android system or application events. All the registered application are notified by the Android runtime once event happens. It works similar to the publish-subscribe design pattern and used for asynchronous inter-process communication. For example, applications can register for various system events like boot complete or battery low, and Android system sends broadcast when specific event occur. Any application can also create its own custom broadcasts. Basics of broadcast Let’s discuss some basic concepts of broadcast receiver. Register Broadcast There are two ways to register broadcast receiver- Manifest-declared (Statically) : By this receiver can be registered via the AndroidManifest.xml file. Context-registered (Dynamically): By this register a receiver dynamically via the Context.registerReceiver() method. Receive Broadcasts To be able to receive a br...