views:

52

answers:

1

I'm trying to find out if it is possible to modify the notification of another app (the calendar app from Samsung) from my own app. Specifically I'd like to change the alarm for a calendar event from a one-time sound (which is silent, if the phone is set to vibrate) to a repeating vibrate.

Can I even modify the notifications belonging to a differnt app?

If I can't, could my app get notified about all notifications and just rethrow my own, modified notifications?

+1  A: 

You probably won't be able to change the notifications of that app because you'd have to modify the app's code directly, where the notification is being fired.

To your second question: If the calendar app communicates over intents, you could create an app which registers on the desired intent (through an Intent filter). When the appropriate intent is fired by the calendar app, you would see a dialog which lets you choose between the applications which can accept it, where also yours should appear. At the same dialog you could then set your app as the default and then handle the notification of the data properly.

Hypothetically, because in the end it depends on how the mentioned Samsung calendar app has been implemented.

Juri
I connected my phone to the adb and displayed the log, but I don't see any activity at the time the alarm happens if the phone is set on vibrate. If sound is enabled on the phone there is an I/NotificationService logged. If I understand that correctly, the app does not fire an intent if set it to vibrate, so my only hope is that Samsung fixes the calendar app (or maybe it is the stock Android app, I don't know how it looks like).
Fabian