Find type of bluetooth device whether mobile or laptop's or mac pc's

不想你离开。 提交于 2019-12-18 08:25:35

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/5989847/find-type-of-bluetooth-device-whether-mobile-or-laptops-or-mac-pcs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!