BleDevice
Stay organized with collections
Save and categorize content based on your preferences.
This class is deprecated.
Use BluetoothManager
directly.
Representation of a BLE Device (such as a heart rate monitor) that broadcasts information
about its on board sensors. The BLE device supports one or more GATT Profiles
, which can be translated to one or more data
type
.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Public Methods
public boolean
equals
( Object
other)
public List
< DataType
>
getDataTypes
()
Returns all of the Fitness Platform data types supported by the device's supported profiles
.
Note that in some GATT profiles certain characteristics are optional. This method
will return an optional data type even if the device doesn't support it. Registering to
updates from a non-supported optional data type from a supported profile will succeed,
but no data will be returned.
public List
< String
>
getSupportedProfiles
()
Returns a list of supported GATT Profile Specification
Types
for the device which are also supported by the Fitness Platform.
public void
writeToParcel
( Parcel
parcel, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eBleDevice\u003c/code\u003e is deprecated; use \u003ccode\u003eBluetoothManager\u003c/code\u003e directly for BLE device interactions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBleDevice\u003c/code\u003e represents a Bluetooth Low Energy device and provides access to its name, address, supported GATT profiles, and data types.\u003c/p\u003e\n"],["\u003cp\u003eAlthough deprecated, \u003ccode\u003eBleDevice\u003c/code\u003e offers methods to retrieve device information like supported data types and GATT profiles, which can be useful for understanding device capabilities.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetDataTypes()\u003c/code\u003e method might return optional data types even if the device doesn't support them, leading to successful registration but no data updates.\u003c/p\u003e\n"]]],["The `BleDevice` class, now deprecated in favor of `BluetoothManager`, represents a BLE device broadcasting sensor data. It supports GATT profiles, translating to Fitness Platform data types. Key actions include retrieving the device's address, name, supported data types, and supported GATT profiles. Methods are provided for object comparison (`equals`), hash code generation (`hashCode`), string representation (`toString`), and parceling (`writeToParcel`). `getDataTypes` indicates supported types, even optional ones which might return no data.\n"],null,["# BleDevice\n\npublic class **BleDevice** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \n**This class is deprecated.** \n\nUse [BluetoothManager](//developer.android.com/reference/android/bluetooth/BluetoothManager.html)\ndirectly.\n\nRepresentation of a BLE Device (such as a heart rate monitor) that broadcasts information\nabout its on board sensors. The BLE device supports one or more [GATT Profiles](/android/reference/com/google/android/gms/fitness/data/BleDevice#getSupportedProfiles()), which can be translated to one or more [data\ntype](/android/reference/com/google/android/gms/fitness/data/BleDevice#getDataTypes()). \n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Method Summary\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/fitness/data/BleDevice#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getAddress](/android/reference/com/google/android/gms/fitness/data/BleDevice#getAddress())() Returns the address of the BLE device, from [BluetoothDevice.getAddress()](//developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getAddress()). |\n| [List](//developer.android.com/reference/java/util/List.html)\\\u003c[DataType](/android/reference/com/google/android/gms/fitness/data/DataType)\\\u003e | [getDataTypes](/android/reference/com/google/android/gms/fitness/data/BleDevice#getDataTypes())() Returns all of the Fitness Platform data types supported by the device's [supported profiles](/android/reference/com/google/android/gms/fitness/data/BleDevice#getSupportedProfiles()). |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getName](/android/reference/com/google/android/gms/fitness/data/BleDevice#getName())() Returns the name of the BLE device, from [BluetoothDevice.getName()](//developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getName()). |\n| [List](//developer.android.com/reference/java/util/List.html)\\\u003c[String](//developer.android.com/reference/java/lang/String.html)\\\u003e | [getSupportedProfiles](/android/reference/com/google/android/gms/fitness/data/BleDevice#getSupportedProfiles())() Returns a list of supported GATT Profile [Specification Types](//developer.bluetooth.org/gatt/profiles/Pages/ProfilesHome.aspx) for the device which are also supported by the Fitness Platform. |\n| int | [hashCode](/android/reference/com/google/android/gms/fitness/data/BleDevice#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/fitness/data/BleDevice#toString())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/fitness/data/BleDevice#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) parcel, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getAddress** ()\n\nReturns the address of the BLE device, from [BluetoothDevice.getAddress()](//developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getAddress()). \n\n#### public [List](//developer.android.com/reference/java/util/List.html)\\\u003c[DataType](/android/reference/com/google/android/gms/fitness/data/DataType)\\\u003e\n**getDataTypes** ()\n\nReturns all of the Fitness Platform data types supported by the device's\n[supported profiles](/android/reference/com/google/android/gms/fitness/data/BleDevice#getSupportedProfiles()).\n\nNote that in some GATT profiles certain characteristics are optional. This method\nwill return an optional data type even if the device doesn't support it. Registering to\nupdates from a non-supported optional data type from a supported profile will succeed,\nbut no data will be returned. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getName** ()\n\nReturns the name of the BLE device, from [BluetoothDevice.getName()](//developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getName()). \n\n#### public [List](//developer.android.com/reference/java/util/List.html)\\\u003c[String](//developer.android.com/reference/java/lang/String.html)\\\u003e\n**getSupportedProfiles** ()\n\nReturns a list of supported GATT Profile [Specification\nTypes](//developer.bluetooth.org/gatt/profiles/Pages/ProfilesHome.aspx) for the device which are also supported by the Fitness Platform. \n\n#### public int **hashCode** ()\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) parcel, int flags)"]]