I'm trying to code a Timer-App with C# for Windows Phone 8.1 Runtime. My goal is to show a dialog and play a sound file when the timer is ended. If the user press "OK" the sound is stopped. Also a "Snooze" function would be great. Maybe not in this app, but I'm planning a personalized alarm clock too. Because I could add the TimeSpan for the timer to DateTime.Now it would be the easiest way to trigger at a specified time. Here are some ideas i had, but they don't do exactly what I want.
- Register a background task. But there's no trigger for a specified time. Only a TimeTrigger which fires at most every 30 min. A solution, not very resource friendly, methinks, would be to look up if the expected time is within the next 30 minutes and await the specified time in the background task and use a ContantDialog. Not sure if this is possible at all.
- Another possibility is to use a toast notification, but there is no possibility of interaction and it is not very impressive, if you want someone to notice the timer.
- Alarms and Reminders are no longer available for RT apps...
Is there no other way? If there is a trigger for background tasks if internet connection is active, isn't there any trigger for a scheduled time? Or maybe a possibility to code something like the old Alarms and Reminders by myself?
Sorry that there is no code. But I don't have some useful code for this problem yet.
How would you solve this problem? Maybe for a timer, an alarm clock, a calender, a task reminder or something else that needs an interaction at a scheduled time. Thanks for your help.