Alarm
Tizen enables you to schedule an application to be run at a specific time. When an alarm is triggered, the application is launched (unless it is already running).
The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.
The main features of the Alarm API include:
- Alarm management
You can manage alarms by creating and deleting them. Both relative and absolute alarms are available: the relative alarm is triggered after a specified delay from the moment it is created, while an absolute alarm is triggered at a specified time and date.
You can also create a recurring alarm that is repeated after a specified period of time, or on the given days of the week at a defined time.
With the getAll() method, you can obtain a list of all existing alarms on the device.
- Application launches with alarms
You can set an alarm to launch an application when triggered.
- Alarm events
You can retrieve information about the next alarm event using the AlarmAbsolute (in mobile and wearable applications) and AlarmRelative (in mobile and wearable applications) interfaces. They provide the time and date of the next scheduled absolute alarm, or the time remaining before the next relative alarm.
To define a time period for the relative alarm or for the recurrence of an absolute alarm, you can use the following predefined constants from the Alarm API:
- tizen.alarm.PERIOD_MINUTE represents the number of seconds in a minute (60).
- tizen.alarm.PERIOD_HOUR represents the number of seconds in an hour (3600).
- tizen.alarm.PERIOD_DAY represents the number of seconds in a day (86400).
- tizen.alarm.PERIOD_WEEK represents the number of seconds in a week (604800).