Android Question Mediaplayer on bluetooth earphone

LUHUANWEI

Member
Licensed User
I used below code start bluetooth earphone, but the voice still come from speaker instead of bluetooth earphone when Mediaplayer play a media file, how can I play the Media ONLY from bluetooth earphone?

Sub StartBluetoothSco()
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String")
r.RunMethod("startBluetoothSco")

r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String")
r.RunMethod2("setMode", 2, "java.lang.int")
End Sub
 

LUHUANWEI

Member
Licensed User
Hi Erel,
Thanks for your help.
Still not works on my device, only when I play the midia and then restart my bluetooth earphone the voice will come from bluetooth, otherwise the voice still from speaker.
 
Upvote 0
Top