Alarm notification

Jiří Wolker woljiri at gmail.com
Tue Aug 24 10:05:43 BST 2021


On 24. 08. 21 9:32, Ianseeks wrote:> Is there anyway I can get a 
notification on my desktop when the alarm on my phone activates (android 
8)?  I get a notification to say that its been set up and thats the end 
of it.

Hi,

AFAIK, there is not such feature. I have found 3 methods to get alarm 
notifications implemented. All of them have some limitations.

Getting alarm list
──────────────────

According to this Stack Overflow question (link below), it is not 
possible to get list of active alarms (that were created using the 
system-provided clock app) without having either root permissions or ADB 
shell access, and therefore the KDEConnect app cannot be able to get 
alarm information to the desktop.

It would be nice feature, but Android does not provide any means to do 
that (on device that is not rooted) – for example, controlling the 
Android device remotely would be also quite good feature, but similar 
limitations apply.

→ Not possible (without using root access).

Detection of the “alarm ringing” activity
─────────────────────────────────────────

I do not know how the alarms in the clock app on Android work, but maybe 
it is possible to detect whether the “alarm ringing” activity is opened. 
That would not allow showing the alarm name on desktop and it would not 
be possible to get vibrate/ring/silent/… settings, but at the 
notification could show *whether* the alarm rings.

Many device manufacturers perform various modifications to the system 
and these modifications could possibly break this functionality. Even 
changing clock app ID or activity name would break such notification.

→ Possible, but very brittle when manufacturer's custom UI is used. 
Alarm would not ring when disconnected and no metadata about alarm would 
be available.

Parsing the ongoing alarm notifications
───────────────────────────────────────

KDEConnect app is able to read the notifications and it could parse it 
and provide information about alarms. That would be possible, but even 
subtle modification of notification text (done by manufacturer's 
modifications, by update etc.) would break it.

→ Breaks easily, but provides metadata and alarm information *before* 
the alarm rings.

                                 •  •  •

The promised link:

     https://stackoverflow.com/questions/21949522/


More information about the KDEConnect mailing list