Closed GoogleCodeExporter closed 8 years ago
Added AlarmScheduler nonvisible component.
The alarm is handled through the android system. This means it has to open
either a Form, or FormService. The form/formservice that gets opened by an
alarm throws the "Alarm" event (the event is thrown by the Form/FormService
itself).
Usage:
[In the Form which sets the alarm]
// Declare
private AlarmScheduler scheduler;
// Initialize in $define
scheduler = new AlarmScheduler(this);
// Set a new alarm for 5 seconds from now, and have it open AlarmForm
long timeToWake = System.currentTimeMillis() + 5000;
scheduler.addAlarm("Alarm1", timeToWake, AlarmForm.class, false);
The first argument is simply a name for the alarm. You can cancel an alarm, and
to do so, you use this name to cancel it.
The second argument is the time in milliseconds for the alarm to go off.
The third argument is the form, or formservice to open when the alarm goes off.
The fourth is just a boolean telling the method if it's a Form, or FormService
that needs to be opened.
I'll also be adding another method similar to this which will wake the screen
if it has gone to sleep.
Original comment by IMPINC...@gmail.com
on 25 May 2012 at 10:43
Original comment by IMPINC...@gmail.com
on 25 May 2012 at 10:43
Does AlarmScheduler extend AlarmManager?
Original comment by bric...@gmail.com
on 26 May 2012 at 2:33
No. It uses AlarmManager, but doesn't extend it.
Original comment by IMPINC...@gmail.com
on 26 May 2012 at 2:56
Added addWakeAlarm method which works the same as the addAlarm method, only
this will wake the screen up if it is asleep.
Original comment by IMPINC...@gmail.com
on 26 May 2012 at 5:13
This does not seem to be working properly...I mean it does if the application
is running, by my understanding is that the Alarm Manager is meant to start the
application if it is not running. In attempting to implement this I have
noticied it only works if the application is already running...
Original comment by bric...@gmail.com
on 27 May 2012 at 8:07
Original comment by IMPINC...@gmail.com
on 8 Jun 2012 at 6:37
Original issue reported on code.google.com by
bric...@gmail.com
on 23 May 2012 at 7:50