Creating Alarm Application for Windows Phone
Join the DZone community and get the full member experience.Join For Free
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…
Published at DZone with permission of Andrea Haubner, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.