reachify
reachify

Reputation: 3827

Alarm feature with Mango update

In the mango update will it be possible to start the app and set an alarm for e.g. 09:00 the next morning. Then close the app and go to sleep. The next morning the alarm should start with sounds (wav files) contained in the application (and not default wp7 sounds)?

Ive seen at the docs and found out the Reminder class would needed to be used. But I didnt get if this will be possible....

Upvotes: 1

Views: 434

Answers (1)

Chris Koenig
Chris Koenig

Reputation: 2748

Here's a sample of code taken from Derik's reference in the comment above that will, I think, do what you're looking for:

string alarmTimeString = DateTime.Now.AddDays(1).ToString("M/dd/yyyy") + " 09:00";
DateTime alarmTime = DateTime.Parse(alarmTimeString);
Reminder reminder = new Reminder("WakeUpTime")
{
    Title = "Time to wake up!",
    Content = "It's time for you to wake up and get to work!",
    BeginTime = alarmTime,
    ExpirationTime = alarmTime.AddHours(1)
};
ScheduledActionService.Add(reminder);

Thanks Derek for pointing us in the right direction!

Upvotes: 3

Related Questions