






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth explanation of Broadcast Receivers in Android Mobile Application Development. It covers the concept, functionality, and creation process of Broadcast Receivers. The document also includes examples of various broadcast actions and their uses.
Typology: Lecture notes
1 / 11
This page cannot be seen from the preview
Don't miss anything!







How to Create a Broadcast Receiver
Java Receiver public class MyReceiver extends BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
// this code runs once ☺ Toast.makeText(context, "Broadcast Received", Toast.LENGTH_LONG).show();
} }
Example Broadcasts
android.intent.action.ACTION_POWER_CONNECTED android.intent.action.ACTION_POWER_DISCONNECTED android.intent.action.ACTION_SHUTDOWN android.intent.action.AIRPLANE_MODE android.intent.action.BATTERY_CHANGED android.intent.action.BATTERY_LOW android.intent.action.BATTERY_OKAY android.intent.action.BOOT_COMPLETED android.intent.action.CAMERA_BUTTON