Free Android app covering all aspects of addiction, including prevention and treatment

Here’s how to use Broadcast Receivers in your apps: A Tutorial

android broadcast receivers tutorial icon

What you’ll learn

This tutorial will show you how to:

  • Register a Broadcast Receiver in your app’s manifest file. We’ll use this receiver to receive a System broadcast sent when the power cable is plugged into the device
  • Register a Broadcast Receiver in an activity. We’ll use this one to show you how to use permissions to secure your broadcasts and the receiver. This receiver will only receive broadcast intents that have the required permission
  • Use the LocalBroadcastManager to send and receive a local broadcast. A secure way of using broadcasts within your app