It is possible to play media via Bluetooth headset while both BT headset and wire headset are connected? or play media by both BT headset and wire headset in the same time, now only wire headset when I play the media. My code as below.
Sub SetEarPhone(Value As Boolean)
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String")
Dim mode As Int
If Value Then mode = 2 Else mode = 0
r.RunMethod2("setMode", mode, "java.lang.int")
End Sub
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
Sub Activity_Create(FirstTime As Boolean)
SetEarPhone(True)
StartBluetoothSco
End Sub
Sub Activity_Pause(UserClosed As Boolean)
SetEarPhone(False)
End Sub
Sub SetEarPhone(Value As Boolean)
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String")
Dim mode As Int
If Value Then mode = 2 Else mode = 0
r.RunMethod2("setMode", mode, "java.lang.int")
End Sub
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
Sub Activity_Create(FirstTime As Boolean)
SetEarPhone(True)
StartBluetoothSco
End Sub
Sub Activity_Pause(UserClosed As Boolean)
SetEarPhone(False)
End Sub