how to detect incoming Skype/Viber call - android

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?

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

Related

How to make a VOIP app use a carkit like the native call app?

I've been searching for over a week now with no clear solutions.
We are building an ap that can make VOIP calls. The current implementation uses AudioManager.requestAudioFocus to tunnel a voice call over a bluetooth headset or carkit, and can uses the AudioManager state to accept incomming calls or hangup ongoing calls when the accept/hangup button on a headset is pressed. This all works fine.
However, when connected with a carkit that has both an accept and hangup button, the current implementation does nothing when the accept button on the carkit is pressed for an incoming voip call and accepts the call when the reject button is pressed. The carkit display also shows no incoming call.
I want to make the carkit react to our voip app identical as how it reacts to an incoming native call but I can't find anywhere how to do that. From what I've found I believe I need to implement a Bluetooth HFP server on the phone side, and use reflection to access hidden Android API's for that.
Can anyone point me to an example of how to do that? All implementations I can find already do what we do or even less (I looked at the Signal code).

Divert caller to Listen to Music in Android

I have googling about a way to somehow divert an incoming call(RINGING/OFF-HOOK state) to listen to an audio file. So far experts have commented that it is not possible to play music while in call. But is it possible, to divert a caller to a music file so that only he can listen to it ? Here I am referring to a HOLD kind of scenario. Please suggest.

How to send dtmf tones from my application to outgoing call?

I have developed android application which call the other person on button click, but now i want to send dtmf tones from application to that outgoing call when ever i need. so how to do that?
Actually it's possible. It's not so obvious and not so elegant. But it works :)
In my project I requested permission for accessibility service. It gives me possibility to programmatically emulate clicks on the screen. Then I get the screen coordinates for the 'open keyboard' button and all number buttons which I need to press (tones which needed to be send).
Then it's super easy - catch income call with receiver, make small delay and then run sequence of emulated clicks.
Tada 🎉🎉🎉
In case someone need code - I can share it.
You can't send DTMF tones during an active call, but you can send them when you "program" them when you initiate the call. see the following post: https://stackoverflow.com/a/12986066/475472
Actually DTMF possible for key when call alive that time manual key touch and same will send to receiver.
we also check it on embedded gsm module and it will in receiving mode and DTMF enable and after calling when we press any key it will send to receiver side.

How can I play sound when device receive incoming call in android?

I want to receive incoming call automatically that was I done already now I want to play my own created sound to my caller rather than android will use its default mike..
Can is it possible to play our own sound after receiving incoming call?
I refereed this. Can anyone tell me is it possible now?
I searched lot related to this topic but still I am not able to find something useful.
If anyone know about this then please help me..
Thanks in advance.
I found this may be helpful for you
quote from: How to automatically answer call and play prerecorded sound out to the caller and DTMF on Android
"No, sorry, Android has no access to the in-call audio stream. Closest thing is if the device is in speakerphone mode, you can blend your audio into what the speaker plays, which may get picked up by the microphone."
As described here (http://www.krvarma.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/), you should be able to detect this:
To detect the incoming call, we register a BroadcastReceiver for the
action android.intent.action.PHONE_STATE. This will be broadcasted
when there is a change in phone state. The receiving intent will have
an extra string variable TelephonyManager.EXTRA_STATE which describes
the phone state. If this state is TelephonyManager.EXTRA_STATE_RINGING
then there will be another extra string variable
TelephonyManager.EXTRA_INCOMING_NUMBER. This variable contains the
incoming phone number. Note that this variable will not be present
when the state is not TelephonyManager.EXTRA_STATE_RINGING.

Turn Off Sound and screen blink on incoming calls in Android?

I would like to know whether this is actually possible in Android?
When Android phone receives an incoming call from a specific number the phone's ringing should stop and also the screen should not blink. What I mean is the user should not be able to know that there was incoming call, but actually there was.
I do not want to delete any call logs, just to stop sound on incoming call from a specific number and that too at a specific time.
Can someone let me know if this is actually possible?
When Android phone receives an
incoming call from a specific number
the phone's ringing should stop and
also the screen should not blink. What
I mean is the user should not be able
to know that there was incoming call,
but actually there was.
Fortunately, this should not be possible from the SDK. You can be notified that a phone call comes in, but I do not believe you can stop the ringtone, and I am really sure you cannot stop the in-call screen from appearing.

Categories

Resources