This site permanently moved to
https://droidscript.github.io
. Please update links accordingly.
You are being forwarded automatically in 3...
[stay here]
Back
GetBtProfileState
Hello World
Returns the Bluetooth State of a given Bt connection type.
app.GetBtProfileState(
type
) →
String:
“Connected”
or
“Disconnected”
See Also:
CreateBluetoothSerial
Example - Show Bluetooth Profile State
click to expand contents
function
OnStart
(
)
{
var
states
=
"a2dp|headset|gatt|health"
.
split
(
"|"
)
;
var
lst
=
[
]
;
for
(
var
i
in
states
)
{
var
state
=
app
.
GetBtProfileState
(
states
[
i
]
)
;
lst
.
push
(
states
[
i
]
+
+
": "
+
state
)
;
}
app
.
Alert
(
lst
.
join
(
"\n"
)
)
;
}
Copy
Copy All
Run
String:
“a2dp”
or
“headset”
or
“gatt”
or
“health”
loading