title: How does the bluetooth a2dp profile work?
body: <p>I want to create a bluetooth music player application which streams audio from one device to another. I have read everything on the android developers page about <a href="https://developer.android.com/guide/topics/connectivity/bluetooth.html" rel="nofollow noreferrer">bluetooth</a> and I found that a profile called a2dp has been specifically created for audio streaming. However not much has been provided on how to use it. I have also gone through the <a href="https://github.com/googlesamples/android-BluetoothChat" rel="nofollow noreferrer">bluetooth chat example</a> but i have been unable to figure out how to actually send audio and how to receive it. I have also read that a2dp sink functionality has been added as of android 5.0.
  After spending hours on stackoverflow I see numerous questions asking the same thing but without any satisfactory answer.</p>
  
  <p>My main questions are-</p>
  
  <ol>
  <li>How does the bluetooth a2dp profile work?</li>
  <li>Are there better methods to implement audio streaming between
  android devices apart from a2dp?</li>
  </ol>
  
  <p>Any help would be greatly appreciated.</p>