How can I play sound when device receive incoming call in android? - 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.

Related

Need to send DTMF tone from custom dialer

I know this question has been asked many times here on stack , but I would like to confirm this as i need to be sure off . Can we pass DTMF tone using our custom dialer?
I found one very interesting link on git and i managed to setup the code and able to make build .
here is the link of apk :-
https://www.dropbox.com/s/r12qewmz659bf2j/DTMF_demo.apk?dl=0
And the code from where I generate the above build :-
https://github.com/rajeshincorp/UD_SendDtmfToneOverActiveCall
I need your guidance here
Regards.
I tried this and I could sent a DTMF tone in the beggining of the call. If the call was already active, I could not send the DTMF tone, only sending, starting the call. You can send "," to delay the caracters sent, for example, to interact with certain interact voice response.

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 detect incoming Skype/Viber call

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

Controlling SMS notifications

I have created a broadcast receiver that uses the SMS_RECEIVER. So far everything works fine with it. Now I would like to modify the notification settings for the sms e.g. adjust volume, turn on vibrate, change audio file...
Basically, I would like this app to duplicate the custom ringtone notification. So I would get the sms, check the senders phone number, and change the notification accordingly. I'm having trouble finding documentation on how to do this per text message. Could someone please link me to some documentation or a code snipet of how to do this?
(I found an example on how to silence the phone but the problem with that example is the phone will remain silenced until the code/user turns the volume back on. I would like to only perform the action on the text message being received at the time, this way it will not affect other functionality of the phone)

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