Share via


BluetoothAdapter Class

Definition

Represents the local device Bluetooth adapter.

[Android.Runtime.Register("android/bluetooth/BluetoothAdapter", DoNotGenerateAcw=true)]
public sealed class BluetoothAdapter : Java.Lang.Object
[<Android.Runtime.Register("android/bluetooth/BluetoothAdapter", DoNotGenerateAcw=true)>]
type BluetoothAdapter = class
    inherit Object
Inheritance
BluetoothAdapter
Attributes

Remarks

Java documentation for android.bluetooth.BluetoothAdapter.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

ActionConnectionStateChanged

Intent used to broadcast the change in connection state of the local Bluetooth adapter to a profile of the remote device.

ActionDiscoveryFinished

Broadcast Action: The local Bluetooth adapter has finished the device discovery process.

ActionDiscoveryStarted

Broadcast Action: The local Bluetooth adapter has started the remote device discovery process.

ActionLocalNameChanged

Broadcast Action: The local Bluetooth adapter has changed its friendly Bluetooth name.

ActionRequestDiscoverable

Activity Action: Show a system activity that requests discoverable mode.

ActionRequestEnable

Activity Action: Show a system activity that allows the user to turn on Bluetooth.

ActionScanModeChanged

Broadcast Action: Indicates the Bluetooth scan mode of the local Adapter has changed.

ActionStateChanged

Broadcast Action: The state of the local Bluetooth adapter has been changed.

Error

Sentinel error value for this class.

ExtraConnectionState

Extra used by #ACTION_CONNECTION_STATE_CHANGED

        This extra represents the current connection state.
ExtraDiscoverableDuration

Used as an optional int extra field in #ACTION_REQUEST_DISCOVERABLE intents to request a specific duration for discoverability in seconds.

ExtraLocalName

Used as a String extra field in #ACTION_LOCAL_NAME_CHANGED intents to request the local Bluetooth name.

ExtraPreviousConnectionState

Extra used by #ACTION_CONNECTION_STATE_CHANGED

        This extra represents the previous connection state.
ExtraPreviousScanMode

Used as an int extra field in #ACTION_SCAN_MODE_CHANGED intents to request the previous scan mode.

ExtraPreviousState

Used as an int extra field in #ACTION_STATE_CHANGED intents to request the previous power state.

ExtraScanMode

Used as an int extra field in #ACTION_SCAN_MODE_CHANGED intents to request the current scan mode.

ExtraState

Used as an int extra field in #ACTION_STATE_CHANGED intents to request the current power state.

Properties

Address

Returns the hardware address of the local Bluetooth adapter.

BluetoothLeAdvertiser

Returns a BluetoothLeAdvertiser object for Bluetooth LE Advertising operations.

BluetoothLeScanner

Returns a BluetoothLeScanner object for Bluetooth LE scan operations.

BondedDevices

Return the set of BluetoothDevice objects that are bonded (paired) to the local adapter.

Class

Returns the runtime class of this Object.

(Inherited from Object)
DefaultAdapter

Get a handle to the default local Bluetooth adapter.

DiscoverableTimeout
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsDiscovering

Return true if the local Bluetooth adapter is currently in the device discovery process.

IsEnabled

Return true if Bluetooth is currently enabled and ready for use.

IsLe2MPhySupported

Return true if LE 2M PHY feature is supported.

IsLeCodedPhySupported

Return true if LE Coded PHY feature is supported.

IsLeExtendedAdvertisingSupported

Return true if LE Extended Advertising feature is supported.

IsLePeriodicAdvertisingSupported

Return true if LE Periodic Advertising feature is supported.

IsMultipleAdvertisementSupported

Return true if the multi advertisement is supported by the chipset

IsOffloadedFilteringSupported

Return true if offloaded filters are supported

IsOffloadedScanBatchingSupported

Return true if offloaded scan batching is supported

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LeMaximumAdvertisingDataLength

Return the maximum LE advertising data length in bytes, if LE Extended Advertising feature is supported, 0 otherwise.

MaxConnectedAudioDevices
Name

Get the friendly Bluetooth name of the local Bluetooth adapter.

PeerReference (Inherited from Object)
ScanMode

Get the current Bluetooth scan mode of the local Bluetooth adapter.

State

Get the current state of the local Bluetooth adapter.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

CancelDiscovery()

Cancel the current device discovery process.

CheckBluetoothAddress(String)

Validate a String Bluetooth address, such as "00:43:A8:23:10:F0"

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CloseProfileProxy(ProfileType, IBluetoothProfile)

Close the connection of the profile proxy to the Service.

Disable()

Turn off the local Bluetooth adapter&mdash;do not use without explicit user action to turn off Bluetooth.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Enable()

Turn on the local Bluetooth adapter&mdash;do not use without explicit user action to turn on Bluetooth.

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetProfileConnectionState(ProfileType)

Get the current connection state of a profile.

GetProfileProxy(Context, IBluetoothProfileServiceListener, ProfileType)

Get the profile proxy object associated with the profile.

GetRemoteDevice(Byte[])

Get a BluetoothDevice object for the given Bluetooth hardware address.

GetRemoteDevice(String)

Get a BluetoothDevice object for the given Bluetooth hardware address.

GetRemoteLeDevice(String, Int32)
IsLeAudioBroadcastAssistantSupported()
IsLeAudioBroadcastSourceSupported()
IsLeAudioSupported()
JavaFinalize()

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

(Inherited from Object)
ListenUsingInsecureL2capChannel()

Create an insecure L2CAP Connection-oriented Channel (CoC) BluetoothServerSocket and assign a dynamic PSM value.

ListenUsingInsecureRfcommWithServiceRecord(String, UUID)

Create a listening, insecure RFCOMM Bluetooth socket with Service Record.

ListenUsingL2capChannel()

Create a secure L2CAP Connection-oriented Channel (CoC) BluetoothServerSocket and assign a dynamic protocol/service multiplexer (PSM) value.

ListenUsingRfcommWithServiceRecord(String, UUID)

Create a listening, secure RFCOMM Bluetooth socket with Service Record.

Notify()

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

(Inherited from Object)
NotifyAll()

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

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetName(String)

Set the friendly Bluetooth name of the local Bluetooth adapter.

StartDiscovery()

Start the remote device discovery process.

StartLeScan(BluetoothAdapter+ILeScanCallback)
Obsolete.

Starts a scan for Bluetooth LE devices.

StartLeScan(UUID[], BluetoothAdapter+ILeScanCallback)
Obsolete.

Starts a scan for Bluetooth LE devices.

StopLeScan(BluetoothAdapter+ILeScanCallback)
Obsolete.

Stops an ongoing Bluetooth LE device scan.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

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

(Inherited from Object)
Wait(Int64, Int32)

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

(Inherited from Object)
Wait(Int64)

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

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to