title: Android and bluetooth headset volume
body: <p>My problem is - how to set up bluetooth incall audio volume.</p>
  
  <p>Since there some apps for this, no one of them works.</p>
  
  <p>Anyway - no app - create one for yourself. I'm very begginer in android development, so i've tried use audioManager.setStreamVolume(), but without any luck - only internal audio has changed after this.</p>
  
  <p>Even playing with startBluetoothSCO() wasn't the answer.</p>
  
  <p>After looking in logcat, how os responds to pressing volume keys, i found out, that after startBluetoothSCO() volume keys in my phone sends AT commands instead of mangling streams (AT+VGM=0...15).</p>
  
  <p>So my code should look something like this:</p>
  
  <pre><code>AudioManager audioManager = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
  audioManager.startBluetoothSco();
  // send AT commands
  audioManager.stopBluetoothSco();
  </code></pre>
  
  <p>Crawling thru web provide me answer that there's no way to directly access modem (and propably other comm ports) from Android API.</p>
  
  <p>So, maybe someone has any goddamn idea how to prevent resetting BT volume on each connect/disconnect to headset? Using code that i could use by myself, or using some 3-rd party app that is available somewhere.</p>
  
  <p>OS: GB 2.3.4, SGS</p>
  
  <p>Thanks for any ideas.</p>