There are a few holes in that theory. Thanks for the thought though! but RFCOMM is for SPP profiles, not HFP or A2DP or any of those other type of protocols.B4J uses Bluecove I think, which doesn't support A2DP profiles. But does support RFCOMM protocol, so in theory it should be possible to send Headset Profile commands.
Here is some info on the Headset Profile: https://www.amd.e-technik.uni-rostock.de/ma/gol/lectures/wirlec/bluetooth_info/k6_hp.html
Altough the aim in sound quality of the Headset profile is lower than A2DP.
However, I have no idea how you could access the RFCOMM profile via B4J.
It's possible to use RFCOMM via the jSerial library, as you can map Bluetooth ports as serial ports, as @Erel states here in this post: https://www.b4x.com/android/forum/threads/jserial-library.34762/
So I think you can make a connection via the jBluetooth library, and then use that connected bluetooth COM port to send AT commands and transmit sound. This won't be easy though, as this is virgin ground for B4J, I think.
Good luck researching. (Mind the fact that I use 'I think', 'In theory' in my sentences, I'm not an expert by any means.)
You're right, but I clearly stated HSP as the only alternative for audio, because audio can be transmitted over RFCOMM via the HSP protocol. I know this is not the same as A2DP, but it's audio none the less. And it could be a solution if 'great' audio quality isn't a necessity for the project of @alizetiThere are a few holes in that theory. Thanks for the thought though! but RFCOMM is for SPP profiles, not HFP or A2DP or any of those other type of protocols.
So Yes, your right, you can use RFCOMM and pair up Bluetooth adapters to your program, and use them as serial ports. But you can ONLY use them as serial ports. You cant do A2DP Audio or anything else. You need a wrapper or a native DLL that can drill down to the native Bluetooth API to do anything else.
Also as a serial port, What are you going to send AT commands to? Thats the other problem. Send AT commands to what... and AT commands =/= audio. Again audio has its own transport layer and bluetooth stack/protocol known as A2DP.