Projects Alarmio Docs AlarmData

onIdChanged

Type: public void

Moves this AlarmData's preferences to another "id".

Parameter Name Description
id The new id to be assigned
context An active context instance.

onRemoved

Type: public void

Removes this AlarmData's preferences.

Parameter Name Description
context An active context instance.

getName

Type: public String

Returns the user-defined "name" of the alarm, defaulting to "Alarm (1..)" if unset.

Parameter Name Description
context An active context instance.

Returned Value: The alarm name, as a string.

isRepeat

Type: public boolean

Returns whether the alarm should repeat on a set interval or not.

Returned Value: If repeat is enabled for this alarm.

setName

Type: public void

Sets the user-defined "name" of the alarm.

Parameter Name Description
context An active context instance.
name The new name to be set.

setTime

Type: public void

Change the scheduled alarm time.

Parameter Name Description
context An active context instance.
manager An AlarmManager to schedule the alarm on.
timeMillis The UNIX time (in milliseconds) that the alarm should ring at. This is independent to days; if the time correlates to 9:30 on a Tuesday when the alarm should only repeat on Wednesdays and Thursdays, then the alarm will next ring at 9:30 on Wednesday.

setEnabled

Type: public void

Set whether the alarm is enabled.

Parameter Name Description
context An active context instance.
manager An AlarmManager to schedule the alarm on.
isEnabled Whether the alarm is enabled.

setDays

Type: public void

Sets the days of the week that the alarm should ring on. If no days are specified, the alarm will act as a one-time alert and will not repeat.

Parameter Name Description
context An active context instance.
days A boolean array, with a length of 7 (seven days of the week) specifying whether repeat is enabled for that day.

setVibrate

Type: public void

Set whether the alarm should vibrate.

Parameter Name Description
context An active context instance.
isVibrate Whether the alarm should vibrate.

hasSound

Type: public boolean

Return whether the alarm has a sound or not.

Returned Value: A boolean defining whether a sound has been set for the alarm.

getSound

Type: @Nullable public SoundData

Get the SoundData sound specified for the alarm.

Returned Value: An instance of SoundData describing the sound that the alarm should make (or null).

setSound

Type: public void

Set the sound that the alarm should make.

Parameter Name Description
context An active context instance.
sound A SoundData defining the sound that the alarm should make.

getNext

Type: @Nullable public Calendar

Get the next time that the alarm should wring.

Returned Value: A Calendar object defining the next time that the alarm should ring at.

Reference: java.util.Calendar Documentation

set

Type: public Date

Set the next time for the alarm to ring.

Parameter Name Description
context An active context instance.
manager The AlarmManager to schedule the alarm on.

Returned Value: The next Date at which the alarm will ring.

setAlarm

Type: private void

Schedule a time for the alarm to ring at.

Parameter Name Description
context An active context instance.
manager The AlarmManager to schedule the alarm on.
timeMillis A UNIX timestamp specifying the next time for the alarm to ring.

cancel

Type: public void

Cancel the next time for the alarm to ring.

Parameter Name Description
context An active context instance.
manager The AlarmManager that the alarm was scheduled on.

getIntent

Type: private PendingIntent

The intent to fire when the alarm should ring.

Parameter Name Description
context An active context instance.

Returned Value: A PendingIntent that will open the alert screen.