Alarm manager 1.0 beta

  • What is it?

Simple Java program (which I am going to upgrade further, this is beta version) for alarms/timers management. It plays user-defined sound at a time set. If an alarm has passed while the computer was off, a message is shown on a program start-up. So in fact the program may also work a bit like a calendar. Works in background.

  • How did it started and why did I do it?

Why do I write this program? That’s a good question… Maybe because I’m too lazy to get my phone from the night table after I put some food in the oven? ;) I have no idea, but it’s a lot of fun :D And I cannot blame anyone if the program doesn’t work properly or doesn’t have particular features – it’s exactly how I would like it to be (ok, maybe not yet, but it’ll be).

  • What still has to be done?
  1. Recreate a main window:
    – alarms displayed are not sorted (only the first one is the earliest one, the rest is random)
    – it’s ugly :P (I have used JTable but I am going to create it on my own with JComponents)
  2. “new alarm frame” should be entirely rewritten
    – it’s always allowed to set an alarm on 29th of February (I guess that 1st March is set instead)
    – when user enters 8 as an hour (in alarm), the next field should be focused, because nothing else can be entered; in timer this restriction is intentionally turned off so user can set a timer e.g. for 72 hours
    – some parts of code I think are the same for different classes
  3. Create a counter for the first alarm.
  4. Allow some additional options for the main window, like setting it always on top or “undecorated” (i.e. no buttons close/minimize, no resizing, no dragging).
  5. Default sound is not set.
  6. History of last notes.
  7. Different sounds for different alarms.
  8. Saving settings and alarms as editable text files instead of serialization.
  9. Add “snooze” option for alarms passed.
  10. Any other ideas? ;)
  • What interesting does it have and what have I learnt?
  1. Using other JAR files (ok, I knew it before) – in this case I have used JLayer – MP3 library for the Java Platform
  2. Creating a tray icon – that’s where you can add new alarm or exit the program.
  3. Inter-process communication using sockets – starting the program, if one instance is already running, results in adding a new alarm. Opening another file will crash the second program (ok, it will work, but… never mind, just don’t do this).
  4. Locking files – only one instance of a program may be running at the same time (until you copy a file, never mind)
  5. Image files can be included in a JAR library and used from there via getResource method, but it is impossible to create a java.io.File in that way (so included sample.mp3 has to be read as a stream or provided outside the JAR library)
  6. Finally, I have learnt that JFileChooser is slightly buggy and Sun/Oracle is not going to do anything with it (a series of bugs has been reported in 2008).
  • How to download, install and see the code?

Download the program from here. Create a directory for it and unpack downloaded file there. Create a link/shortcut file to Alarm_manager.jar and put it in your autostart (in Windows 7 it’s “shell:startup”). Run the program, in the preference choose an mp3 file you would like to have as your alarm sound (I didn’t test other files). You can close all windows and access them via tray icon if necessary.

Code can be seen here.

If you had any ideas, suggestions, problems (or even complaints)  – let me know.

About Jaroslaw Pawlak

I have done MSci in Computer Science at King’s College London and currently work as Software Engineer specialising in Java. I spend most of my time in front of computer improving my programming (and other) skills or just relaxing with a good game. I also train some sports but at the moment I am not a member of any club. I love cycling and volleyball, but I have also played a lot of football, tennis and trained martial arts.

Posted on June 17, 2011, in My Projects. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: