发现无论是手机还是笔记本电脑的MAC或PC的类型的蓝牙设备 [英] Find type of bluetooth device whether mobile or laptop's or mac pc's
问题描述
我开发Android游戏应用程序通过蓝牙播放。虽然搜索蓝牙设备,结果同时包含移动设备以及Mac PC /笔记本电脑。我想列出只在我的结果列表中的移动设备。是否有可能找到检测的设备是移动设备或没有?
I am developing an android game application played using bluetooth. While searching for bluetooth device, results contain both mobile devices as well as mac pc/laptops. I would like to list only the mobile devices in my result list. Is it possible to find whether the device detected is mobile device or not?
推荐答案
当你有<一个href=\"http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html\">BluetoothDevice你可以调用<一个href=\"http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getBluetoothClass%28%29\">getBluetoothClass.智能手机预计将有<一个href=\"http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.html#PHONE_SMART\">PHONE_SMART值,而计算机应具有COMPUTER_ *值(例如<一href=\"http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.html#COMPUTER_DESKTOP\">COMPUTER_DESKTOP或<一个href=\"http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.html#COMPUTER_LAPTOP\">COMPUTER_LAPTOP).
When you have BluetoothDevice you can call getBluetoothClass. Smart phones are expected to have PHONE_SMART value, while computers should have COMPUTER_* values (for example COMPUTER_DESKTOP or COMPUTER_LAPTOP).
这篇关于发现无论是手机还是笔记本电脑的MAC或PC的类型的蓝牙设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!