11

I am working on an application where I need to transfer call from one device to another through Bluetooth protocol (i.e. I want the way like device transfer the call to hands-free). Any ideas?

6
  • 1
    There's no such thing as "transferring the call" in this context. Transferring a call means moving it from one phone to another phone (whereby the original phone is no longer a part of the call). You're trying to just activate an external speaker/microphone. Android already does this automatically if the previously paired device is discovered to be in range during a call.
    – mah
    Mar 27, 2013 at 11:36
  • @mah so when both devices are paired, lets say device "a" is a pc, and device "b" is a phone, if they're already paired and i get call on my phone, the pc can act like a car-speaker?
    – Elior
    Apr 25, 2013 at 11:57
  • @Elior if your PC plays the role of a bluetooth speaker the way some cars do then yes, but it depends on what functions the pc exposes to remote devices (and though it's possible, it's not something I've heard of being done before... usually it works in the opposite direction -- pc putting out the audio to a remote bluetooth speaker/headset).
    – mah
    Apr 25, 2013 at 13:24
  • @raxpro: Have you been successful at this? because I need exactly that. To use one phone as freehands of another phone.
    – m4l490n
    Sep 25, 2015 at 15:50
  • @m4l490n: I need exactly what you need. Please share your experiences. Dec 10, 2015 at 21:17

1 Answer 1

6

Generally you can't. Android Bluetooth stack implements several Bluetooth profiles including HFP and A2DP. Android is an audio source for both profiles and it streams audio to the connected headset. The headset should implement Hands-Free Unit (HF) functionality and Android - Audio Gateway (AG) - as described on Bluetooth.org.

Now you want HF functionality on Android devices, which by design supports AG. You would need to implement HFP profile (HF side) for the device, which you want in fact to act as a headset. Take a look at the profile model. HFP is based on RFCOMM (supported by Android API) and SDP (which is not present in API). You won't be able to access some parts from BlueDroid (modifying SDP etc.) which are on the stack layer. Therefore your mobile phone can't pretend to be headset with HF functionality.

Of course you can send everything over RFCOMM (which is asynchronous as far as I know) but there is no direct support from Android Bluetooth API for this. Implementation with RFCOMM would require SCO link (SCO socket) and it may also be hidden in Android OS stack layer (couldn't find the way to create such socket via API).

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.