(Untitled)

Jul 28, 2007 18:13

How do I get my Blackberry to alert me at a random time every day? I want to set an alarm that chooses a random time between midnight and 11:59 pm.

Leave a comment

Comments 8

sjp July 29 2007, 06:10:57 UTC
That's a tough one. The short answer is that I don't think you can. Even my 8800 can't do it.

My suggestion would be that if you only need this for a short time, set up appointments in your calendar and enable the alarm function. Otherwise, perhaps find someone who can write you a Java app that can do it.

Reply


iamfourninjas July 29 2007, 06:14:42 UTC
I can host something on my server that will do it.

Reply

Re: did you solve your problem? screen_play August 1 2007, 00:51:51 UTC
Would it be a message?

Reply

Re: did you solve your problem? iamfourninjas August 1 2007, 03:12:21 UTC
it would.

Reply


djchai July 30 2007, 07:39:59 UTC
why in gawd's name would you need this function?

Reply


did you solve your problem? rxw July 31 2007, 23:29:39 UTC
I can whip up a little something that will send you a message at a random time between midnight and 23:59.

  1. it's possible that one alarm will be sent at 23:59, and then the next day's alarm will be sent two minutes later. do you want to have a condition that there must be a minimum time between alarms?
  2. my scheme depends on a few factors out of my control (that the host is running, and that its network connection stay up). how much failure can your project tolerate?

Reply

Re: did you solve your problem? screen_play August 1 2007, 00:52:37 UTC
I can tolerate 10% failure and I prefer no minimum time between alarms. What kind of message would it be?

Reply

Re: did you solve your problem? rxw August 2 2007, 16:30:13 UTC
it would probably be email.

I think this is really two problems:
  1. generate a random time
  2. do something at a specified time

for #1, have randomTimeOfDay extract two bytes from /dev/urandom, and do some math to convert that number into a time of day (probably do a modulo 24 to get the hour, then a modulo 60 to get the minute).

for #2, have alertMe read (once a day, probably at 00:00) that value I just generated, and send an alert when that time came around.

looks like blackberry has a java development environment, and hooks to make new appointments in your calendar. this has the advantage of being completely inside your blackberry (the alert doesn't come in over the network, so it would only fail if your blackberry was powered off), but the disadvantage is, I haven't coded in java in a while.

otherwise, iamfourninjas and I seem to be proposing a similar, alternate solution -- write something on a server that does the same thing. the advantage is probably faster development, and the disadvantage is that the alert depends on lots of things that are ( ... )

Reply


Leave a comment

Up