BluetoothManager  |  API reference  |  Android Developers


public final class BluetoothManager
extends Object



High level manager used to obtain an instance of an BluetoothAdapter and to conduct overall Bluetooth Management.

Use Context.getSystemService(java.lang.String) with Context.BLUETOOTH_SERVICE to create an BluetoothManager, then call getAdapter() to obtain the BluetoothAdapter.

Developer Guides

For more information about using BLUETOOTH, read the Bluetooth developer guide.

.
Requires the PackageManager#FEATURE_BLUETOOTH feature which can be detected using PackageManager.hasSystemFeature(String).

Summary

Public methods

BluetoothAdapter getAdapter()

Get the BluetoothAdapter for this device.

List<BluetoothDevice> getConnectedDevices(int profile)

Get connected devices for the specified profile.

int getConnectionState(BluetoothDevice device, int profile)

Get the current connection state of the profile to the remote device.

List<BluetoothDevice> getDevicesMatchingConnectionStates(int profile, int[] states)

Get a list of devices that match any of the given connection states.

BluetoothGattServer openGattServer(Context context, BluetoothGattServerCallback callback)

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.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public methods