Saturday, June 28, 2008

So Page Brooks was talking with me earlier this week and he had a great idea for another Windows Mobile application. He wants an application that will repeat alerts for missed phones and text messages. I have to admit this is something I could use myself. So I figured I take a crack at it today, since it would make for a fun, simple, Friday app.

 

image

Repeatr

I decided to change up the naming format and play of the popular Web 2.0 naming conventions giving us the name: Repeatr. I have to admit, it is kind of catchy.

I searched for “Web 2.0 Logo Creator” and pretty much went with the first one I saw. This gave me a pretty slick logo in less than 5 minutes. I also decided to make the background a “tooltip” yellow, which I think looks really good.

Other than that everything is rather straight forward. We have checkboxes allowing the user to choose what events we will monitor. And we have a menu with a couple options, namely About and Exit. There is a “Clear Alerts” menu item, as well, that allows users to acknowledge they have responded to the alert(s).

The application allows user to select the number of minutes between alerts up to 60 minutes.

Of course we are using the State and Notification Broker to make all this happen. Using it means we hardly have to write any code ourselves!

State and Notification Broker setup code

   1: SystemState phoneMissedCalls = new SystemState(SystemProperty.PhoneMissedCalls);
   2: SystemState messagingSmsUnread = new SystemState(SystemProperty.MessagingSmsUnread);
   3: SystemState messagingTotalEmailUnread = new SystemState(SystemProperty.MessagingTotalEmailUnread);
   4: SystemState messagingVoiceMailTotalUnread = new SystemState(SystemProperty.MessagingVoiceMailTotalUnread);
   5:  
   6: private void frmMain_Load(object sender, EventArgs e)
   7: {
   8:     phoneMissedCalls.Changed += new ChangeEventHandler(phoneMissedCalls_Changed);
   9:     messagingSmsUnread.Changed += new ChangeEventHandler(messagingSmsUnread_Changed);
  10:     messagingTotalEmailUnread.Changed += new ChangeEventHandler(messagingTotalEmailUnread_Changed);
  11:     messagingVoiceMailTotalUnread.Changed += new ChangeEventHandler(messagingVoiceMailTotalUnread_Changed);
  12: }

 

The way we alert a user to having missed a monitored event is by playing a sounds which is easy to do.

   1: [DllImport("aygshell.dll")]
   2: static extern uint SndPlaySync(string pszSoundFile, uint dwFlags);
   3:  
   4: void PlaySound()
   5: {
   6:     string path;
   7:     path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
   8:  
   9:     SndPlaySync(Path.Combine(path, "alert.wma"), 0);
  10: }

Other than a little plumbing to make everything work together that is basically the entire app in a nutshell.

Possibilities:

This is a pretty spiffy application. But software can always be better. An option to allow the phone to vibrate would be great. Another option to allow the user to select the alert sound would be nice too.

Download executable: repeatr.cab

Download Source Code: repeatr.zip

Feedback:

Want more? What else would you like to see? Time’s running out on submitting ideas. Be sure to get yours in soon!


Saturday, June 28, 2008 02:30:00 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback Tracked by:
"30 Days of .NET [Windows Mobile Applications] - Week Four" (Chris Craft's Blog) [Trackback]

Comments are closed.

Theme design by Jelle Druyts

Pick a theme: