Thursday, August 26, 2010

DonnsAlarm v1.1

This will hopefully be a quickly updated release, but there were some significant improvements so I figured I should at least post this. Plus I found what appears to be a great site for posting/storing my code online for free(box.net).

The alarm was working really pretty well for me, but only because some of the issues were related to uses that I originally never intended to use it for and therefore never tested. Discovered a couple combinations of current time and setting the alarm time that would cause the alarm to occur immediately instead of when I intended. I also realized I was doing some stupid comparisons for managing the two times, current and alarm. I removed some code basically with the change in technique. The initial technique was very brute force, this version is much more simple, elegant and more like how the time was intended to be handled.

So I have embedded the code and the main driver class as that code was the one that changed the most. I have linked the rest of the files for reference as well as to the final APK.

There are still a couple known issues/features to add with this release which is why I hope to follow up in a couple days with a v1.2.

The Known Issues/Features to Add:
Bug - Backing out of Main Activity, using the back button, resets all user preferences. When activity reloads, the "Enabled" check box is cleared after enabling it previously. The alarm stays scheduled and will occur. It can be disabled by enabling and then disabling an alarm.

Feature - Disabling the Time Picker Hour/Minute/AMPM controls when an Alarm is Enabled


DonnsAlarm.java


DonnsAlarm.java (This is the Main Driver Class)
AlarmReceiver.java (This receives the alarm)
AlarmActivity.java (This is for the alarm.xml layout)
alarm.xml (This is the layout for the alarm when it occurs.)
alarmclock.xml (This is the main layout)
AndroidManifest.xml (This is the applications manifest file)

Sadly, I will be distracted with my Arduino's Ethernet Shield that just arrived and I am also expecting my TTL=>RS232 converter soon. I will be writing sketches for the new hardware, but I will try to work in some more testing time and at least another update as soon as possible.

1 comment: