SlideShare a Scribd company logo
Android
Broadcast
Receiver
Android Training
By Khaled Anaqwa
Broadcast Receiver
 A broadcast receiver (short receiver) is an
Android component which allows you to
register for system or application events.
 All registered receivers for an event will be
notified by the Android runtime once this
event happens.
 For example applications can register for the
ACTION_BOOT_COMPLETED system event
which is fired once the Android system has
completed the boot process.
Lifecycle of a broadcast
receiver
 After the onReceive() of the
BroadcastReceiver has finished, the
Android system can recycle the
BroadcastReceiver.
System broadcasts
 Several system events are defined as final
static fields in the Intent class.
Important system events
Implementation
 A receiver can be registered via the
AndroidManifest.xml file.
 Alternatively to this static registration, you
can also register a broadcast receiver
dynamically via the
Context.registerReceiver() method.
 The implementing class for a receiver
extends the BroadcastReceiver class.
In AndroidManifest.xml
<receiver android:name=“.MyReciver" >
intent-filter>
<action
android:name="android.intent.action.ACTION_POWE
R_CONNECTED" />
</intent-filter>
</receiver>
BroadcastReceiver Imp
public class MyReciver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context,
"Yor Mobile Will be Charge… !",
Toast.LENGTH_LONG).show();
}
}
Register a broadcast receiver
dynamically
registerReceiver(new MyReciver(), filter);
unregisterReceiver(MyReciver)

More Related Content

What's hot

Broadcast Receiver
Broadcast ReceiverBroadcast Receiver
Broadcast Receiver
NandanAdeshara
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
Yong Heui Cho
 
Broadcast Receivers in Android
Broadcast Receivers in AndroidBroadcast Receivers in Android
Broadcast Receivers in Android
ma-polimi
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
Ahsanul Karim
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
shuklajiawesome
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentation
Niraj Singh
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
Lavakush Verma
 
Google cloud messaging
Google cloud messagingGoogle cloud messaging
Google cloud messagingAmardeep Vijay
 
GCM Android
GCM AndroidGCM Android
GCM Androidaswapnal
 

What's hot (10)

Broadcast Receiver
Broadcast ReceiverBroadcast Receiver
Broadcast Receiver
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
 
Broadcast Receivers in Android
Broadcast Receivers in AndroidBroadcast Receivers in Android
Broadcast Receivers in Android
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
Gcm tutorial
Gcm tutorialGcm tutorial
Gcm tutorial
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentation
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
Google cloud messaging
Google cloud messagingGoogle cloud messaging
Google cloud messaging
 
GCM Android
GCM AndroidGCM Android
GCM Android
 

Viewers also liked

Android Training (android fundamental)
Android Training (android fundamental)Android Training (android fundamental)
Android Training (android fundamental)
Khaled Anaqwa
 
Android Training (Touch)
Android Training (Touch)Android Training (Touch)
Android Training (Touch)
Khaled Anaqwa
 
Android training (android style)
Android training (android style)Android training (android style)
Android training (android style)
Khaled Anaqwa
 
Android Training (Services)
Android Training (Services)Android Training (Services)
Android Training (Services)
Khaled Anaqwa
 
Android Training (ScrollView , Horizontal ScrollView WebView)
Android Training (ScrollView , Horizontal ScrollView  WebView)Android Training (ScrollView , Horizontal ScrollView  WebView)
Android Training (ScrollView , Horizontal ScrollView WebView)
Khaled Anaqwa
 
Android Training (Notifications)
Android Training (Notifications)Android Training (Notifications)
Android Training (Notifications)
Khaled Anaqwa
 
Chapter 5 ms access-1
Chapter 5   ms access-1Chapter 5   ms access-1
Chapter 5 ms access-1Pratik Gupta
 
Android Transition
Android TransitionAndroid Transition
Android Transition
Charile Tsai
 
Android Training (Animation)
Android Training (Animation)Android Training (Animation)
Android Training (Animation)
Khaled Anaqwa
 
MS Access Training
MS Access TrainingMS Access Training
MS Access Training
Michael Sheyahshe
 
Uses of MS Access in Business
Uses of MS Access in BusinessUses of MS Access in Business
Uses of MS Access in Business
Biswajit Bhattacharjee
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
PRITI TELMORE
 
Wi-Fi Direct
Wi-Fi DirectWi-Fi Direct
Wi-Fi Direct
shivam_kedia
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)
Khaled Anaqwa
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
Khaled Anaqwa
 
Wifi direct p2p app
Wifi direct p2p appWifi direct p2p app
Wifi direct p2p app
geniushkg
 
Android Sensor System
Android Sensor SystemAndroid Sensor System
Android Sensor System
Yi-Hsiang Huang
 
Chapter 3 storage media and devices
Chapter 3   storage media and devicesChapter 3   storage media and devices
Chapter 3 storage media and devicesPratik Gupta
 
Chapter 8 system analysis and design
Chapter 8   system analysis and designChapter 8   system analysis and design
Chapter 8 system analysis and designPratik Gupta
 
Introduction to Wi-Fi Direct
Introduction to Wi-Fi DirectIntroduction to Wi-Fi Direct
Introduction to Wi-Fi DirectWei-Tsung Su
 

Viewers also liked (20)

Android Training (android fundamental)
Android Training (android fundamental)Android Training (android fundamental)
Android Training (android fundamental)
 
Android Training (Touch)
Android Training (Touch)Android Training (Touch)
Android Training (Touch)
 
Android training (android style)
Android training (android style)Android training (android style)
Android training (android style)
 
Android Training (Services)
Android Training (Services)Android Training (Services)
Android Training (Services)
 
Android Training (ScrollView , Horizontal ScrollView WebView)
Android Training (ScrollView , Horizontal ScrollView  WebView)Android Training (ScrollView , Horizontal ScrollView  WebView)
Android Training (ScrollView , Horizontal ScrollView WebView)
 
Android Training (Notifications)
Android Training (Notifications)Android Training (Notifications)
Android Training (Notifications)
 
Chapter 5 ms access-1
Chapter 5   ms access-1Chapter 5   ms access-1
Chapter 5 ms access-1
 
Android Transition
Android TransitionAndroid Transition
Android Transition
 
Android Training (Animation)
Android Training (Animation)Android Training (Animation)
Android Training (Animation)
 
MS Access Training
MS Access TrainingMS Access Training
MS Access Training
 
Uses of MS Access in Business
Uses of MS Access in BusinessUses of MS Access in Business
Uses of MS Access in Business
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
Wi-Fi Direct
Wi-Fi DirectWi-Fi Direct
Wi-Fi Direct
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
Wifi direct p2p app
Wifi direct p2p appWifi direct p2p app
Wifi direct p2p app
 
Android Sensor System
Android Sensor SystemAndroid Sensor System
Android Sensor System
 
Chapter 3 storage media and devices
Chapter 3   storage media and devicesChapter 3   storage media and devices
Chapter 3 storage media and devices
 
Chapter 8 system analysis and design
Chapter 8   system analysis and designChapter 8   system analysis and design
Chapter 8 system analysis and design
 
Introduction to Wi-Fi Direct
Introduction to Wi-Fi DirectIntroduction to Wi-Fi Direct
Introduction to Wi-Fi Direct
 

Similar to Android Training (Broadcast Receiver)

Android BroadcastReceiver - How to start a service using BroadcastReceiver
Android BroadcastReceiver - How to start a service using BroadcastReceiverAndroid BroadcastReceiver - How to start a service using BroadcastReceiver
Android BroadcastReceiver - How to start a service using BroadcastReceiver
SriSankeerth Reddy
 
Android broadcast receiver tutorial
Android broadcast receiver   tutorialAndroid broadcast receiver   tutorial
Android broadcast receiver tutorial
maamir farooq
 
Android App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgetsAndroid App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgets
Diego Grancini
 
BroadcastReceivers in Android
BroadcastReceivers in AndroidBroadcastReceivers in Android
BroadcastReceivers in Android
Perfect APK
 
Android Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAndroid Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAhsanul Karim
 
Android Wear, a developer's perspective
Android Wear, a developer's perspectiveAndroid Wear, a developer's perspective
Android Wear, a developer's perspective
Sebastian Vieira
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
easychen
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
34ShreyaChauhan
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principlesHenk Laracker
 
Reactive Data System
Reactive Data SystemReactive Data System
Reactive Data System
Pridhvi Kodamasimham
 
Android intents, notification and broadcast recievers
Android intents, notification and broadcast recieversAndroid intents, notification and broadcast recievers
Android intents, notification and broadcast recieversUtkarsh Mankad
 
Android sensor
Android sensorAndroid sensor
Android sensor
pyingkodi maran
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptx
KNANTHINIMCA
 
Android Components & Manifest
Android Components & ManifestAndroid Components & Manifest
Android Components & Manifest
ma-polimi
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
maamir farooq
 
Unit2
Unit2Unit2
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
Robert Cooper
 
Android App Development - 14 location, media and notifications
Android App Development - 14 location, media and notificationsAndroid App Development - 14 location, media and notifications
Android App Development - 14 location, media and notifications
Diego Grancini
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
master760
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
Jagannath Das
 

Similar to Android Training (Broadcast Receiver) (20)

Android BroadcastReceiver - How to start a service using BroadcastReceiver
Android BroadcastReceiver - How to start a service using BroadcastReceiverAndroid BroadcastReceiver - How to start a service using BroadcastReceiver
Android BroadcastReceiver - How to start a service using BroadcastReceiver
 
Android broadcast receiver tutorial
Android broadcast receiver   tutorialAndroid broadcast receiver   tutorial
Android broadcast receiver tutorial
 
Android App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgetsAndroid App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgets
 
BroadcastReceivers in Android
BroadcastReceivers in AndroidBroadcastReceivers in Android
BroadcastReceivers in Android
 
Android Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAndroid Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver Tutorial
 
Android Wear, a developer's perspective
Android Wear, a developer's perspectiveAndroid Wear, a developer's perspective
Android Wear, a developer's perspective
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principles
 
Reactive Data System
Reactive Data SystemReactive Data System
Reactive Data System
 
Android intents, notification and broadcast recievers
Android intents, notification and broadcast recieversAndroid intents, notification and broadcast recievers
Android intents, notification and broadcast recievers
 
Android sensor
Android sensorAndroid sensor
Android sensor
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptx
 
Android Components & Manifest
Android Components & ManifestAndroid Components & Manifest
Android Components & Manifest
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
 
Unit2
Unit2Unit2
Unit2
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Android App Development - 14 location, media and notifications
Android App Development - 14 location, media and notificationsAndroid App Development - 14 location, media and notifications
Android App Development - 14 location, media and notifications
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 

More from Khaled Anaqwa

Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)
Khaled Anaqwa
 
Android Training (Sensors)
Android Training (Sensors)Android Training (Sensors)
Android Training (Sensors)
Khaled Anaqwa
 
Android Training (Media)
Android Training (Media)Android Training (Media)
Android Training (Media)
Khaled Anaqwa
 
Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)
Khaled Anaqwa
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)
Khaled Anaqwa
 
Android Training (Intro)
Android Training (Intro)Android Training (Intro)
Android Training (Intro)Khaled Anaqwa
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
Khaled Anaqwa
 

More from Khaled Anaqwa (7)

Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)
 
Android Training (Sensors)
Android Training (Sensors)Android Training (Sensors)
Android Training (Sensors)
 
Android Training (Media)
Android Training (Media)Android Training (Media)
Android Training (Media)
 
Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)
 
Android Training (Intro)
Android Training (Intro)Android Training (Intro)
Android Training (Intro)
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 

Recently uploaded

Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Android Training (Broadcast Receiver)

  • 2. Broadcast Receiver  A broadcast receiver (short receiver) is an Android component which allows you to register for system or application events.  All registered receivers for an event will be notified by the Android runtime once this event happens.  For example applications can register for the ACTION_BOOT_COMPLETED system event which is fired once the Android system has completed the boot process.
  • 3. Lifecycle of a broadcast receiver  After the onReceive() of the BroadcastReceiver has finished, the Android system can recycle the BroadcastReceiver.
  • 4. System broadcasts  Several system events are defined as final static fields in the Intent class.
  • 6. Implementation  A receiver can be registered via the AndroidManifest.xml file.  Alternatively to this static registration, you can also register a broadcast receiver dynamically via the Context.registerReceiver() method.  The implementing class for a receiver extends the BroadcastReceiver class.
  • 7. In AndroidManifest.xml <receiver android:name=“.MyReciver" > intent-filter> <action android:name="android.intent.action.ACTION_POWE R_CONNECTED" /> </intent-filter> </receiver>
  • 8. BroadcastReceiver Imp public class MyReciver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Yor Mobile Will be Charge… !", Toast.LENGTH_LONG).show(); } }
  • 9. Register a broadcast receiver dynamically registerReceiver(new MyReciver(), filter); unregisterReceiver(MyReciver)