SlideShare a Scribd company logo
4
Most read
13
Most read
18
Most read
Romain	
  Chiappinelli	
  
Alarms
Alarms
AlarmManager APIs
Alarm Types
Example Application
Mechanism for sending Intents at
some point in the future
Allows one application to make code
execute, even when that application
is no longer running
Once registered, Alarms remain
active even if the device is asleep
Can set configure Alarms to wake
a sleeping device
Alarms are canceled on device
shutdown/restart
MMS - Retry Scheduler
Settings - Bluetooth Discoverable
timeout
Phone - User Info Cache
Create & manage alarms indirectly, by
interacting with the AlarmManager
Get a reference to the AlarmManager
by calling the Context class’
getSystemService(Context.ALARM_SERVICE)
// one-shot alarm
void set(int type, long triggerAtTime, "

 
 PendingIntent operation)
// repeating alarm 
void setRepeating(int type, "

 
 
 long triggerAtTime, "

 
 
 long interval, "

 
 
 PendingIntent operation)
// repeating alarm with inexact trigger criteria
void setInexactRepeating(int type, "

 
 
 
 long triggerAtTime, "

 
 
 
 long interval, "

 
 
 
 PendingIntent operation)
Interval options
INTERVAL_FIFTEEN_MINUTES
INTERVAL_HALF_HOUR
INTERVAL_HOUR
INTERVAL_HALF_DAY
INTERVAL_DAY
Two degrees of configurability
How to interpret time
What to do if the device is sleeping
when the Alarm fires
Realtime - relative to system clock
Elapsed - relative to time since
last boot
Wake up device now & deliver Intent
Wait to deliver Intent until device
wakes up
RTC_WAKEUP
RTC
ELAPSED_REALTIME
ELAPSED_REALTIME_WAKEUP
PendingIntent getActivity("

 
 
Context context, "

 
 
int requestCode, Intent intent, "

 
 
int flags, Bundle options)
PendingIntent getBroadcast("

 
 
 
Context context, "

 
 
 
int requestCode, "

 
 
 
Intent intent, int flags)
PendingIntent getService("

 
 
 
Context context, "

 
 
 
int requestCode, "

 
 
 
Intent intent, int flags)
Alarms
Alarms
Alarms
Alarms
Alarms
Alarms
Alarms
Alarms
Networking

More Related Content

PDF
Android ui dialog
Krazy Koder
 
PDF
Android notification
Krazy Koder
 
PPTX
Android Services
Ahsanul Karim
 
PDF
Android animation
Krazy Koder
 
PPTX
Broadcast Receiver
nationalmobileapps
 
PDF
Android Basic Components
Jussi Pohjolainen
 
PDF
Android graphics
Krazy Koder
 
PPTX
Aidl service
Anjan Debnath
 
Android ui dialog
Krazy Koder
 
Android notification
Krazy Koder
 
Android Services
Ahsanul Karim
 
Android animation
Krazy Koder
 
Broadcast Receiver
nationalmobileapps
 
Android Basic Components
Jussi Pohjolainen
 
Android graphics
Krazy Koder
 
Aidl service
Anjan Debnath
 

What's hot (20)

PPT
Data Storage In Android
Aakash Ugale
 
PPTX
Notification android
ksheerod shri toshniwal
 
PPTX
SQLite database in android
Gourav Kumar Saini
 
PPTX
Android - Application Framework
Yong Heui Cho
 
PPTX
Android AIDL Concept
Charile Tsai
 
PPTX
Android app development
Tanmoy Roy
 
PDF
Android Multimedia Support
Jussi Pohjolainen
 
PPT
Android - Android Intent Types
Vibrant Technologies & Computers
 
PPTX
Android presentation - Gradle ++
Javier de Pedro López
 
DOCX
Android menus in android-chapter15
Dr. Ramkumar Lakshminarayanan
 
PPTX
Fragment
nationalmobileapps
 
PPTX
Flutter Intro
Vladimir Parfenov
 
PPTX
Event Handling in java
Google
 
PPTX
android architecture
Aashita Gupta
 
PPTX
Broadcast receivers
maamir farooq
 
PDF
Introduction to flutter
Wan Muzaffar Wan Hashim
 
PDF
AndroidManifest
Ahsanul Karim
 
PPT
Day 4: Android: UI Widgets
Ahsanul Karim
 
PPT
android menus
Deepa Rani
 
PPTX
How to create a camera2
Booch Lin
 
Data Storage In Android
Aakash Ugale
 
Notification android
ksheerod shri toshniwal
 
SQLite database in android
Gourav Kumar Saini
 
Android - Application Framework
Yong Heui Cho
 
Android AIDL Concept
Charile Tsai
 
Android app development
Tanmoy Roy
 
Android Multimedia Support
Jussi Pohjolainen
 
Android - Android Intent Types
Vibrant Technologies & Computers
 
Android presentation - Gradle ++
Javier de Pedro López
 
Android menus in android-chapter15
Dr. Ramkumar Lakshminarayanan
 
Flutter Intro
Vladimir Parfenov
 
Event Handling in java
Google
 
android architecture
Aashita Gupta
 
Broadcast receivers
maamir farooq
 
Introduction to flutter
Wan Muzaffar Wan Hashim
 
AndroidManifest
Ahsanul Karim
 
Day 4: Android: UI Widgets
Ahsanul Karim
 
android menus
Deepa Rani
 
How to create a camera2
Booch Lin
 
Ad

Similar to Alarms (20)

PPTX
Will it run or will it not run? Background processes in Android 6 - Anna Lifs...
DroidConTLV
 
PPTX
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
 
PDF
How to integrate flurry in android
adityakumar2080
 
PDF
Android L04 - Notifications and Threading
Mohammad Shaker
 
PPTX
java Unit4 chapter1 applets
raksharao
 
PPT
The Timer
Gaurav Paliwal
 
DOCX
ANET SureLog SIEM IntelligentResponse
Ertugrul Akbas
 
DOCX
Sdl cctv sms v_ 5.0
Mahesh Kumar Parvathareddy
 
PDF
Annunciator for Hazard Prevention & Temperature Control
IOSR Journals
 
PDF
IntelligentSurveillanceSystem
ANH NGUYEN
 
PDF
follow-app BOOTCAMP 2: Windows phone fast application switching
QIRIS
 
PPT
Operating system lecture 2. batch system.memory layout
fahim shahzad
 
PPTX
What's new in Windows Phone Mango for Developers
Glen Gordon
 
PDF
Manual of the CSS Alarm Handler (Beast)
Robert-Emmanuel Mayssat
 
PPT
Prevent Rsi
guest3425aaea
 
PDF
Automation and Robotics 20ME51I_Week_4_Practicals.pdf
Gandhibabu8
 
PDF
A9 mini gps tracker user manual shenzhen i365-tec...
Alejandro Jose Ore Vargas
 
PDF
Android Implementation using MQTT Protocol
Fatih Özlü
 
DOCX
Sdl cctv sms v_ 4.0
Mahesh Kumar Parvathareddy
 
PPTX
Class based modeling
Md. Shafiuzzaman Hira
 
Will it run or will it not run? Background processes in Android 6 - Anna Lifs...
DroidConTLV
 
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
 
How to integrate flurry in android
adityakumar2080
 
Android L04 - Notifications and Threading
Mohammad Shaker
 
java Unit4 chapter1 applets
raksharao
 
The Timer
Gaurav Paliwal
 
ANET SureLog SIEM IntelligentResponse
Ertugrul Akbas
 
Sdl cctv sms v_ 5.0
Mahesh Kumar Parvathareddy
 
Annunciator for Hazard Prevention & Temperature Control
IOSR Journals
 
IntelligentSurveillanceSystem
ANH NGUYEN
 
follow-app BOOTCAMP 2: Windows phone fast application switching
QIRIS
 
Operating system lecture 2. batch system.memory layout
fahim shahzad
 
What's new in Windows Phone Mango for Developers
Glen Gordon
 
Manual of the CSS Alarm Handler (Beast)
Robert-Emmanuel Mayssat
 
Prevent Rsi
guest3425aaea
 
Automation and Robotics 20ME51I_Week_4_Practicals.pdf
Gandhibabu8
 
A9 mini gps tracker user manual shenzhen i365-tec...
Alejandro Jose Ore Vargas
 
Android Implementation using MQTT Protocol
Fatih Özlü
 
Sdl cctv sms v_ 4.0
Mahesh Kumar Parvathareddy
 
Class based modeling
Md. Shafiuzzaman Hira
 
Ad

More from maamir farooq (20)

DOCX
Ooad lab1
maamir farooq
 
PPT
Lesson 03
maamir farooq
 
PPT
Lesson 02
maamir farooq
 
PDF
Php client libray
maamir farooq
 
PDF
Swiftmailer
maamir farooq
 
PDF
Lect15
maamir farooq
 
PDF
Lec 7
maamir farooq
 
PPTX
Lec 6
maamir farooq
 
PDF
Lec 5
maamir farooq
 
PDF
J query 1.7 cheat sheet
maamir farooq
 
PDF
Assignment
maamir farooq
 
PDF
Java script summary
maamir farooq
 
PDF
Lec 3
maamir farooq
 
PDF
Lec 2
maamir farooq
 
PPTX
Lec 1
maamir farooq
 
PPTX
Css summary
maamir farooq
 
DOCX
Manual of image processing lab
maamir farooq
 
PDF
Session management
maamir farooq
 
PDF
Data management
maamir farooq
 
PPTX
Content provider
maamir farooq
 
Ooad lab1
maamir farooq
 
Lesson 03
maamir farooq
 
Lesson 02
maamir farooq
 
Php client libray
maamir farooq
 
Swiftmailer
maamir farooq
 
J query 1.7 cheat sheet
maamir farooq
 
Assignment
maamir farooq
 
Java script summary
maamir farooq
 
Css summary
maamir farooq
 
Manual of image processing lab
maamir farooq
 
Session management
maamir farooq
 
Data management
maamir farooq
 
Content provider
maamir farooq
 

Recently uploaded (20)

PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 

Alarms

  • 4. Mechanism for sending Intents at some point in the future Allows one application to make code execute, even when that application is no longer running
  • 5. Once registered, Alarms remain active even if the device is asleep Can set configure Alarms to wake a sleeping device Alarms are canceled on device shutdown/restart
  • 6. MMS - Retry Scheduler Settings - Bluetooth Discoverable timeout Phone - User Info Cache
  • 7. Create & manage alarms indirectly, by interacting with the AlarmManager Get a reference to the AlarmManager by calling the Context class’ getSystemService(Context.ALARM_SERVICE)
  • 8. // one-shot alarm void set(int type, long triggerAtTime, " PendingIntent operation)
  • 9. // repeating alarm void setRepeating(int type, " long triggerAtTime, " long interval, " PendingIntent operation)
  • 10. // repeating alarm with inexact trigger criteria void setInexactRepeating(int type, " long triggerAtTime, " long interval, " PendingIntent operation) Interval options INTERVAL_FIFTEEN_MINUTES INTERVAL_HALF_HOUR INTERVAL_HOUR INTERVAL_HALF_DAY INTERVAL_DAY
  • 11. Two degrees of configurability How to interpret time What to do if the device is sleeping when the Alarm fires
  • 12. Realtime - relative to system clock Elapsed - relative to time since last boot
  • 13. Wake up device now & deliver Intent Wait to deliver Intent until device wakes up
  • 15. PendingIntent getActivity(" Context context, " int requestCode, Intent intent, " int flags, Bundle options) PendingIntent getBroadcast(" Context context, " int requestCode, " Intent intent, int flags) PendingIntent getService(" Context context, " int requestCode, " Intent intent, int flags)