I'm new in Android development (for instance I know that in iOS it's not possible).
I know, that to just make a call I need:
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + bundle.getString("mobilePhone")));
context.startActivity(intent);
But is it possible to call a phone xxxxxxxxx and then instead of voice the other user should hear a voice file (for instance mp3 file placed in my Android project)? So the only task of the application is to call a number, to play a file and then to stop a call.
Is it possible with Android?
I'm afraid this is not the answer you are looking for:
There are currently no way to send data to a ongoing call. The google havn't released any API for this functionality. You can only control a call in the sense of ending, muting, parking etc. like this. It is also possible to record calls, however, this does not happen by using the any class in the telephony
package directly instead by using the MediaRecorder
Found this SO answer describing the issue closer. It is simply not possible, in most cases not even using NDK. I'll mark this a duplicate, since the answer already exists.
For more curious people, i recommend reading this SO answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With