2

I want to start my application (let's say BRUSH YOUR TEETH)on a specific time and day. And I don't want to write the alarm service any extra code for alarm part. Rather, I want to know if it is possible:

1- I use original alarm clock that comes shipped with phone to set up alarm with some name. Let's say Time= "6:30 AM on Monday" and Name= "PSSST!! BRUSH YOUR TEETH"

2- The Alarm will start to ring on Monday morning at 6:30 AM with that PSST!!... name

3- My question here, does this alarm broadcasts any INTENT (for instance like INTENT.ACTION.BOOTCOMPLETE) that can be received with BROADCAST RECEIVER so that I start my activity in OnReceieve method?

In short I am too lazy to write additional code and want to use the existing phone clock service.

Any possibility of success with my lazy approach?

Mario Kutlev
  • 4,897
  • 7
  • 44
  • 62

1 Answers1

0

It's not exact answer on your question. However, I would recommend to use AlarmManager:

http://developer.android.com/reference/android/app/AlarmManager.html

All you need to do is to create an intent for your app and schedule it. It is pretty much minimal (2-3 lines for setting it up, one receiver and definition of receiver in manifest).

You can check example here:

Alarm Manager Example

Community
  • 1
  • 1
Victor Ronin
  • 22,758
  • 18
  • 92
  • 184