Over a million developers have joined DZone.

Creating Alarm Application for Windows Phone

· Mobile Zone

I don’t have a kitchen timer, but who cares? I have a Windows Phone, right? So I just created a little Alarm application to compensate for missing kitchen equipment.

It is a very simple application that has a TextBlock (for instructions), a TextBox, where I can set the alarm (I chose to set that in seconds), and two buttons. One for setting the alarm, the other one for resetting it:

By clicking the ‘Set Alarm’ Button I set the alarm. A method called ‘CreateAlarm’ will be created. This method will create the instance of the alarm by passing a name to the constructor. I am also going to add a little alarm message:

“ScheduledActionService.Add(alarm)” will let the alarm go off when the application has been closed. It will execute in the background.

Works as expected. I just have to make sure to press the ‘Reset Alarm’ Button after an alarm went off, to prevent it from crashing. I am sure there is room for improvement, but for now, I am happy with that.

 

To be continued…

Topics:

Published at DZone with permission of Andrea Haubner, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}