Projects Alarmio Docs Alarmio

newAlarm

Type: public AlarmData

Create a new alarm, assigning it an unused preference id.

Returned Value: The newly instantiated AlarmData.

removeAlarm

Type: public void

Remove an alarm and all of its its preferences.

Parameter Name Description
alarm The alarm to be removed.

onAlarmCountChanged

Type: public void

Update preferences to show that the alarm count has been changed.

onAlarmsChanged

Type: public void

Notify the application of changes to the current alarms.

newTimer

Type: public TimerData

Create a new timer, assigning it an unused preference id.

Returned Value: The newly instantiated TimerData.

removeTimer

Type: public void

Remove a timer and all of its preferences.

Parameter Name Description
timer The timer to be removed.

onTimerCountChanged

Type: public void

Update the preferences to show that the timer count has been changed.

onTimersChanged

Type: public void

Notify the application of changes to the current timers.

onTimerStarted

Type: public void

Starts the timer service after a timer has been set.

getPrefs

Type: public SharedPreferences

Get an instance of SharedPreferences.

Returned Value: The instance of SharedPreferences being used by the application.

Reference: android.content.SharedPreferences Documentation

updateTheme

Type: public void

Update the application theme.

isNight

Type: public boolean

Determine if the theme should be a night theme.

Returned Value: True if the current theme is a night theme.

getActivityTheme

Type: public int

Get the theme to be used for activities and things. Despite what the name implies, it does not return a theme resource, but rather one of Alarmio.THEME_DAY_NIGHT, Alarmio.THEME_DAY, Alarmio.THEME_NIGHT, or Alarmio.THEME_AMOLED.

Returned Value: The theme to be used for activites.

isDayAuto

Type: public boolean

Determine if the sunrise/sunset stuff should occur automatically.

Returned Value: True if the day/night stuff is automated.

getDayStart

Type: public int

Returned Value: the hour of the start of the day (24h), as specified by the user

getDayEnd

Type: public int

Returned Value: the hour of the end of the day (24h), as specified by the user

getSunrise

Type: @Nullable public Integer

Returned Value: the hour of the calculated sunrise time, or null.

getSunset

Type: @Nullable public Integer

Returned Value: the hour of the calculated sunset time, or null.

getSunsetCalculator

Type: @Nullable private SunriseSunsetCalculator

Returned Value: the current SunriseSunsetCalculator object, or null if it cannot be instantiated.

Reference: SunriseSunsetLib Repo

isRingtonePlaying

Type: public boolean

Determine if a ringtone is currently playing.

Returned Value: True if a ringtone is currently playing.

getCurrentRingtone

Type: @Nullable public Ringtone

Get the currently playing ringtone.

Returned Value: The currently playing ringtone, or null.

playStream

Type: private void

Play a stream ringtone.

Parameter Name Description
url The URL of the stream to be passed to ExoPlayer.

Reference: ExoPlayer Repo

playStream

Type: public void

Play a stream ringtone.

Parameter Name Description
url The URL of the stream to be passed to ExoPlayer.

Reference: ExoPlayer Repo

playStream

Type: public void

Play a stream ringtone.

Parameter Name Description
url The URL of the stream to be passed to ExoPlayer.
attributes The attributes to play the stream with.

Reference: ExoPlayer Repo

stopStream

Type: public void

Stop the currently playing stream.

setStreamVolume

Type: public void

Sets the player volume to the given float.

Parameter Name Description
volume The volume between 0 and 1

isPlayingStream

Type: public boolean

Determine if the passed url matches the stream that is currently playing.

Parameter Name Description
url The URL to match the current stream to.

Returned Value: True if the URL matches that of the currently playing stream.

stopCurrentSound

Type: public void

Stop the currently playing sound, regardless of whether it is a ringtone or a stream.