查找蓝牙设备的类型,无论是移动设备、笔记本电脑还是 Mac 电脑 [英] Find type of bluetooth device whether mobile or laptop's or mac pc's

查看:20
本文介绍了查找蓝牙设备的类型,无论是移动设备、笔记本电脑还是 Mac 电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用蓝牙玩的安卓游戏应用程序.在搜索蓝牙设备时,结果包含移动设备以及 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?

推荐答案

当你有 BluetoothDevice 你可以调用 getBluetoothClass.智能手机应具有 PHONE_SMART 值,而计算机应该有 COMPUTER_* 值(例如 COMPUTER_DESKTOPCOMPUTER_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 电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆