Android Alarm What is the difference between four types of Alarm that AlarmManager provides and when to use what?

后端 未结 4 1347
我在风中等你
我在风中等你 2021-01-11 15:50

I want to know the difference between RTC, RTC_WAKEUP, ELAPSED_REALTIME, ELAPSED_REALTIME_WAKEUP.
I want to write an alarm application where I will set

4条回答
  •  时光说笑
    2021-01-11 16:12

    There are two general clock types for alarms: "elapsed real time" and "real time clock" (RTC). Elapsed real time uses the "time since system boot" as a reference, and real time clock uses UTC (wall clock) time. This means that elapsed real time is suited to setting an alarm based on the passage of time (for example, an alarm that fires every 30 seconds) since it isn't affected by time zone/locale. The real time clock type is better suited for alarms that are dependent on current locale.

    Source: https://developer.android.com/training/scheduling/alarms.html

提交回复
热议问题