How to stream audio from one Android device to another Android device Via Bluetooth? How to stream audio from one Android device to another Android device Via Bluetooth? android android

How to stream audio from one Android device to another Android device Via Bluetooth?


Is it possible to stream audio over Bluetooth?

Below sort of thread says its possibility that streaming audio over Bluetooth is possible between devices but there was question mark on its success rates till Google official announced that We have fixed the a2dp streaming stutter problem on N7. The next release should have the fix.Sorry about the problem.

Fix for poor A2DP quality on 4.2.2

Bluetooth sound quality suffer after upgrade to 4.2 with Galaxy Nexus

Android 4.3 Bluetooth Audio Quality Fix for Nexus 7 Flo

And does every android device support A2DP?

Support compatibility is mention on Android developers site that its added from API Level-11 with appropriate features. But I came across XDA tread where OP mention problem in Android 2.1,means its also support in previous api levels but OP facing issues.

Hope it make sense to understand and I would like to recommend to refer XDA forum to get more information about A2DP compatibility and its sucess.


I my opinion, if A2DP doesn't work properly, we'd better move to lower layer, and we can create a basic stream which can be used for sending any form of date. I succeed in sending byte stream via Bluetooth between J2ME devices.

If install an app in both devices is acceptable, I've sample codes to create a Bluetooth server and a client to communicate with each other via socket, once the socket is established, you can send you audio stream :)

here are some core codes:

1) server device:

// you can generate your own UUID and use it as an port to eatablish a socketprivate static final UUID MY_UUID = UUID.fromString("20687DAD-B023-F19E-2F60-A135554CC3FD")BluetoothServerSocket serverSocket = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME_INSECURE, MY_UUID);

now you have the serverSocket, just use it as an ordinary ServerSocket:

BluetoothSocket socket = serverSocket.accept();

and then you can get InputStream and OutputStream from this BluetoothSocket and send audio stream just like HttpConnection

2) client device:

assume you already got the BluetoothDevice

// you should implement the method getBlutoothDeviceBluetoothDevice device = getBluetoothDevice();BluetoothSocket socket = device.createRfcommSocketToServiceRecord(MY_UUID_SECURE);


You can also stream audio over a basic SCO connection which is not dependent on any profile. However, be aware that A2DP is a profile that was developed specifically for streaming music. So any implementation that you make yourself will suffer in quality compared to A2DP.

Unless you are streaming music to a device which does not support A2DP, I would certainly use A2DP. Really your only other option is to use a SCO link.