I am developing a music app and for that I need to detect incoming calls (Phone, Skype, Viber etc) in order to stop the playing song. I can detect GSM calls using PhoneState listener. Is there any way to detect data/VoIP (Skype, Viber) calls?
Asked
Active
Viewed 3,412 times
6
-
Check the solution here. http://stackoverflow.com/questions/22904514/call-detection-for-skype-in-android – Amit Jan 04 '16 at 09:18
1 Answers
7
You shouldn't need to detect anything so specific, but rather manage audio focus correctly. Please see this guide on how to do that: https://developer.android.com/training/managing-audio/audio-focus.html

Karakuri
- 38,365
- 12
- 84
- 104
-
Thanks, I want to know whenever phone rings by Skype or Viber call. for which stream should I request? STREAM_ALARM, STREAM_DTMF, STREAM_MUSIC,STREAM_NOTIFICATION, STREAM_RING, STREAM_SYSTEM, STREAM_VOICE_CALL – SohailAziz Apr 28 '14 at 13:45
-
Seems like `STREAM_RING` and `STREAM_VOICE_CALL` sound like good candidates. Try them out and see what happens. You can probably request more than one stream I would think. – Karakuri Apr 28 '14 at 18:51
-
@Karakuri Hi karakuri, do you get solution for detect incomming/outgoing calls for Skype. – challa sathish kumar Dec 31 '14 at 05:21
-