安卓如何蓝牙设备的类别?

安卓编程中怎么区分蓝牙设备;比如有些程序扫描完附近的蓝牙设备之后,就能识别出是电脑还是还是手机。想知道这是怎么实现的

看看这个吧对你有帮助的     https://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.Major.html

调用BluetoothAdapter的方法startDiscovery()启动蓝牙扫描, 扫描到设备系统会发送一个广播, BluetoothEventManager会去接收此广播,
在onReceive方法的参数中有BluetoothDevice即代表了搜索到的蓝牙设备,BluetoothDevice中就包含了蓝牙的类型, 名称等信息. 如果你想了解
的更加详细, 那么就阅读系统代码, 然后一步步追踪到底层的调用...

这里有说明:
http://blog.csdn.net/q610098308/article/details/45248423

具体实现 int deviceType = device.getBluetoothClass().getMajorDeviceClass();
不同设备类型该值不同,比如computer蓝牙为256、phone 蓝牙为512、打印机蓝牙为1536等等