Android: Can you send/receive data along a phonecall?

∥☆過路亽.° 提交于 2019-12-01 03:34:17

What you are doing there is not possible. When you make a phone call to another device, it isn't necessarily an Android device you are calling. The boolean you are sending to the call intent is being read by that intent and not sent to the other device in the call.

If you want to send data to another telephone device, you can send up touch tones. These are the sounds made by button presses (So for example, if you ring your bank and they ask you to press one for customer service, two for telephone banking etc, those key presses send a slightly different tone along the connection which the receiver regonises as being a touch press for "one" and "two", so can perform some action).

You would need to send touch tones to the phone call, and also handle recieving them at the other end. Correct implementation will allow the two Android phones to communicate, as if sending data.

They are also commonly referred to as DTMF tones.

Intent mIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber + ";" + dtmfSequence));

The code above will send the DTMF tones with the phone call.

I'm not sure how to access the audio stream on the reciever device, so you would have to look into this yourself, to get hold of the stream and listen for the DTMF tones.

Good luck, hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!