Catching alarm event

All your problems with Audio, Video and Images.

Catching alarm event

Postby gyubok » Wed Jul 06, 2011 10:55 pm

Hi all, I am new here (+developing in general) and this is my first post (exciting!)!

Anyway, I am wondering how I would catch an alarm clock event. I am trying to create an app that is semi integrated with system alarm clock. I am trying to catch when the system alarm clock goes off then start my app 10 mins later. How would I go about doing this?

If it is impossible to catch alarm event, how would I approach this problem to make it happen? Is there any other apps that starts an activity based on when the system alarm clock goes off?

Thanks in advance!
gyubok
Freshman
Freshman
 
Posts: 3
Joined: Wed Jul 06, 2011 9:06 am

Top

Re: Catching alarm event

Postby abhijitphatak28 » Fri Jul 08, 2011 7:53 am

You can look for AlarmManager in android which will solve your purpose.

http://developer.android.com/reference/ ... nager.html

Thanks

Regards
-Abhijit
User avatar
abhijitphatak28
Senior Developer
Senior Developer
 
Posts: 102
Joined: Sat Feb 12, 2011 1:18 pm
Location: Indore

Re: Catching alarm event

Postby gyubok » Sat Jul 09, 2011 2:05 pm

Hi thanks for the reply :)!

The AlarmManager class deals with creating alarm broadcast/receive within the app. However, what I am trying to figure out is to catch system alarm clock (the one where you set with the default clock app). I know that
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Settings.System.getString(getContentResolver(), Settings.System.NEXT_ALARM_FORMATTED);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

will give you when the system alarm clock is SET to but is irrelevant regarding actually catching the event.
Is there a way for my app to open up when alarm rings? I'm trying to create a news/rss reader for the user when they wake up :)

p.s. I just found about
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Settings.System.ALARM_ALERT
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

What does that one do? What purpose does it serve? The java doc only says
Persistent store for the system-wide default alarm alert.
See Also

RINGTONE
DEFAULT_ALARM_ALERT_URI
Constant Value: "alarm_alert"

That absolutely gives nothing :(
gyubok
Freshman
Freshman
 
Posts: 3
Joined: Wed Jul 06, 2011 9:06 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 12 guests