java.lang.Object | |
↳ | android.bluetooth.BluetoothManager |
High level manager used to obtain an instance of an
BluetoothAdapter
and to conduct overall Bluetooth Management.
Use
getSystemService(java.lang.String)
with
BLUETOOTH_SERVICE
to create an
BluetoothManager
,
then call
getAdapter()
to obtain the
BluetoothAdapter
.
Alternately, you can just call the static helper
getDefaultAdapter()
.
For more information about using BLUETOOTH, read the Bluetooth developer guide.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Get the default BLUETOOTH Adapter for this device.
|
||||||||||
|
Get connected devices for the specified profile.
|
||||||||||
|
Get the current connection state of the profile to the remote device.
|
||||||||||
|
Get a list of devices that match any of the given connection
states.
|
||||||||||
|
Open a GATT Server
The callback is used to deliver results to Caller, such as connection status as well
as the results of any other GATT server operations.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Get the default BLUETOOTH Adapter for this device.
Get connected devices for the specified profile.
Return the set of devices which are in state
STATE_CONNECTED
This is not specific to any application configuration but represents the connection state of Bluetooth for this profile. This can be used by applications like status bar which would just like to know the state of Bluetooth.
Requires
BLUETOOTH
permission.
profile | GATT or GATT_SERVER |
---|
Get the current connection state of the profile to the remote device.
This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter for certain profile. This can be used by applications like status bar which would just like to know the state of Bluetooth.
Requires
BLUETOOTH
permission.
device | Remote bluetooth device. |
---|---|
profile | GATT or GATT_SERVER |
STATE_CONNECTED
,
STATE_CONNECTING
,
STATE_DISCONNECTED
,
STATE_DISCONNECTING
Get a list of devices that match any of the given connection states.
If none of the devices match any of the given states, an empty list will be returned.
This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter for this profile. This can be used by applications like status bar which would just like to know the state of the local adapter.
Requires
BLUETOOTH
permission.
profile | GATT or GATT_SERVER |
---|---|
states |
Array of states. States can be one of
STATE_CONNECTED
,
STATE_CONNECTING
,
STATE_DISCONNECTED
,
STATE_DISCONNECTING
,
|
Open a GATT Server The callback is used to deliver results to Caller, such as connection status as well as the results of any other GATT server operations. The method returns a BluetoothGattServer instance. You can use BluetoothGattServer to conduct GATT server operations.
context | App context |
---|---|
callback | GATT server callback handler that will receive asynchronous callbacks. |