Android Question Recognize Third Party App Open

canalrun

Well-Known Member
Licensed User
Longtime User
Is there a way to recognize when a third-party app opens on screen?

I would like to recognize on Android when Skype has an incoming call. Skype will pop up a full page screen announcing the incoming call.

If the call is missed Skype posts a notification of the missed call. I use Erel's NotificationListener to detect this missed call notification and I flash some Wi-Fi connected light bulbs. The problem is this is a "missed call notification", so the other party has already hung up. Skype currently does not have an "incoming call notification".

I would hope that there is something like the NotificationListener that I could use to detect when Skype opens the page announcing an incoming call. I would then use this to flash the light bulbs.

Is it possible to detect a third-party app opening? Can anyone point me in the right direction?

Thanks,
Barry.
 

OliverA

Expert
Licensed User
Longtime User
Please note that the above linked solution has been deprecated since Lollipop (API 21)
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
You can use my accessibility services library. If I recall correctly I exposed a method or event to get the current activity
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User

Please note that the above linked solution has been deprecated since Lollipop (API 21)

You can use my accessibility services library. If I recall correctly I exposed a method or event to get the current activity

Thanks. Polling for the currently running activity is definitely a possibility. Polling every 15 seconds or so 24 hours a day doesn't sound nice, but it's on an older phone (API 23), the phone is dedicated to this one task, and it's constantly plugged in to the charger – so I guess the usual warnings about polling don't matter.

I will have to play around and see if the Skype screen that pops up has a unique activity name. Skype pulls all sorts of tricks so it may be the same activity as the normal Skype calling page just showing a different view.

Barry.
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
Upvote 0
Top