me.at.coding
me.at.coding

Reputation: 17654

Programmatically change bluetooth volume?

I need to create an application that will change the bluetooth headset volume by pressing the volume up/down keys [on the phone]. While I yet don't know how to catch the volume up/down keys, I am currently more interested in how one can change the bluetooth headset volume programmatically?

Note: I want to have the bluetooth volume dialog one gets when using the phones volume up/down keys while making a call using bluetooth and the phones normal dialer / GSM call.

Upvotes: 2

Views: 8331

Answers (2)

Vinayakkumar
Vinayakkumar

Reputation: 6490

Answered here how to increase and decrease the volume programmatically in android

and you should use

public static final int STREAM_BLUETOOTH_SCO = AudioSystem.STREAM_BLUETOOTH_SCO;

instead of STREAM_MUSIC

Upvotes: 0

me.at.coding
me.at.coding

Reputation: 17654

Find the solution spread over this three threads:

Android Bluetooth Earpiece Volume

Trigger system volume bar

Android - Volume Buttons used in my application

Don't forget this permission:

    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> 

Thanks to Doomsknight for the initial hint :-)

Upvotes: 1

Related Questions