5,600,664 Members 37,352 Now Online
XDA Developers Android and Mobile Development Forum

[Q][Dev]How does a Android AlarmClock work?

Tip us?
 
moritz31
Old
#1  
Senior Member - OP
Thanks Meter 110
Posts: 173
Join Date: May 2013

 
DONATE TO ME
Default [Q][Dev]How does a Android AlarmClock work?

Hey Guys,

it maybe sounds a bit stupid, but i exactly want to know how the alarm clock works. If u create an alarm, the informations must be saved somewhere and if u activate an alarm there must be an service in the background which look if the time is right and then send an intent to an activity ? This service have to run every time the phone is on. Am i right ?

The reason why i want to know this, is because i'm writing an app which is in this point very similar to an android alarm clock. How it works:
The user enter a start and end time , in this time the app should do something, but it should not only work while the user is in the app, it should also work when the user is in another app, on the home screen or when the display is off.
I already tried it with 2 activities, a Broadcast, but it won't really work

Have you guys maybe an idea how i can reach my goal?

Hope i'm in the right section of this forum

Moritz
 
shimp208
Old
#2  
shimp208's Avatar
Recognized Contributor
Thanks Meter 1331
Posts: 1,983
Join Date: Jan 2011
Location: Boston

 
DONATE TO ME
Quote:
Originally Posted by moritz31 View Post
Hey Guys,

it maybe sounds a bit stupid, but i exactly want to know how the alarm clock works. If u create an alarm, the informations must be saved somewhere and if u activate an alarm there must be an service in the background which look if the time is right and then send an intent to an activity ? This service have to run every time the phone is on. Am i right ?

The reason why i want to know this, is because i'm writing an app which is in this point very similar to an android alarm clock. How it works:
The user enter a start and end time , in this time the app should do something, but it should not only work while the user is in the app, it should also work when the user is in another app, on the home screen or when the display is off.
I already tried it with 2 activities, a Broadcast, but it won't really work

Have you guys maybe an idea how i can reach my goal?

Hope i'm in the right section of this forum

Moritz
I am by no means an expert in the subject but I would recommend taking a look at this information, as well as this documentation on Android Process Life-cycle.
 
moritz31
Old
#3  
Senior Member - OP
Thanks Meter 110
Posts: 173
Join Date: May 2013

 
DONATE TO ME
it is maybe possible to use http://developer.android.com/referen...rmManager.html as Service, so i can wake my app up with this and don't have to write my own ...
Tags
alarm, android, app, clock, service
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes