BluetoothDevice.LeAppearance Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get the Bluetooth LE Appearance of the remote device.
public int LeAppearance { [Android.Runtime.Register("getLeAppearance", "()I", "", ApiSince=37)] [Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")] get; }
[<get: Android.Runtime.Register("getLeAppearance", "()I", "", ApiSince=37)>]
[<get: Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.LeAppearance : int
Property Value
the LE Appearance value, or #LE_APPEARANCE_UNKNOWN if the appearance is
unknown or not yet available.
- Attributes
Remarks
Get the Bluetooth LE Appearance of the remote device.
The LE Appearance values are defined by the Bluetooth SIG and provide a visual representation of the device type. For a complete list of valid LE Appearance values, refer to the Bluetooth Assigned Numbers document.
This value is returned from the local cache and can be retrieved even when the device is disconnected. The value represents a static physical characteristic and typically stays constant throughout the lifetime of a device.
The cache is populated either by extracting Appearance AD type from LE advertisements during device discovery prior to pairing, or by performing a GATT read on the GAP service's Appearance characteristic on first LE connection.
According to the Bluetooth SIG GAP specifications, the Appearance characteristic does not support GATT notifications/indications. The changes to a device's appearance are only broadcasted for bonded devices using the ACTION_LE_APPEARANCE_CHANGED intent containing the new EXTRA_LE_APPEARANCE value. For apps targeting Build.VERSION_CODES.R or lower, this requires the Manifest.permission.BLUETOOTH permission which can be gained with a simple <uses-permission> manifest tag. For apps targeting Build.VERSION_CODES.S or or higher, this requires the Manifest.permission.BLUETOOTH_CONNECT permission which can be gained with android.app.Activity.requestPermissions(String[],int). Requires Manifest.permission.BLUETOOTH_CONNECT
Android reference for android.bluetooth.BluetoothDevice.getLeAppearance.
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.