1

In Android 10 there was no provision to launch an activity from a background service like BroadcastReceiver. I am curious to understand how android's default alarm application is loading a snooze/stop activity from the background service. I am trying to implement the same functionality but cannot succeed to launch an activity when the BroadcastReceiver is triggered.

I would like to know how the alarm snooze/stop activity is triggered in the background even though the screen is locked in Android 10. Thanks in advance for helping me understand the concept behind it

Ram Keerthy
  • 227
  • 4
  • 16
  • Android does not have a "default alarm application". Android devices might have one supplied and configured by the device manufacturer. Since device manufacturers control their device and firmware, manufacturer-installed apps often have capabilities that exceed what a third-party developer can achieve. You are also making assumptions about the nature of what that app is doing, such as its use of a background service. – CommonsWare Dec 20 '19 at 12:03
  • Thank you for the reply. Sorry for the misunderstanding about background services in alarm clock. Is it possible to know what is the architecture they use for alarm? – Ram Keerthy Dec 20 '19 at 15:32
  • Alarm clocks typically use `AlarmManager` and [its `setAlarmClock()` method](https://developer.android.com/reference/android/app/AlarmManager?hl=en#setAlarmClock(android.app.AlarmManager.AlarmClockInfo,%20android.app.PendingIntent)), AFAIK. – CommonsWare Dec 20 '19 at 21:59

0 Answers0