I am getting bluetooth device connected. Trying to get the device type.
val pairedDevices: Set<BluetoothDevice> = mBluetoothAdapter.bondedDevices
Check BluetoothClass
Represents a Bluetooth class, which describes general characteristics and capabilities of a device. For example, a Bluetooth class will specify the general device type such as a phone, a computer, or headset, and whether it's capable of services such as audio or telephony.
With getBluetoothClass()
you should be able to retrieve this type of informations.
Remember the permission in your AndroidManifest.xml
<uses-permission android:name="android.permission.BLUETOOTH" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.