
蓝牙涉及到的主要类BluetoothAdapter 本地蓝牙适配器BluetoothClass 蓝牙类BluetoothClass.Device 蓝牙设备BluetoothClass.Device.Major 蓝牙设备管理BluetoothClass.Service 蓝牙服务BluetoothDevice 远程蓝牙设备BluetoothSocket 蓝牙服务器端SocketBluetoothServerSock…

蓝牙涉及到的主要类
BluetoothAdapter 本地蓝牙适配器
BluetoothClass 蓝牙类
BluetoothClass.Device 蓝牙设备
BluetoothClass.Device.Major 蓝牙设备管理
BluetoothClass.Service 蓝牙服务
BluetoothDevice 远程蓝牙设备
BluetoothSocket 蓝牙服务器端Socket
BluetoothServerSocket 蓝牙 Socket
其中BluetoothAdapter最为重要,主要方法有
cancelDiscovery() 取消当前搜索过程
checkBluetoothAdress() 检查蓝牙地址是否正确
disable() 关闭蓝牙适配器
enable()打开蓝牙适配器
getAddress() 取的本地蓝牙的硬件适配器地址
getDefaultAdapter() 得到默认的蓝牙适配器
getName() 得到蓝牙的名字
getRemoteDevice() 得到指定地址的BluetoothDevice对象
getScanMode() 得到扫描模式
getState() 得到扫描状态
isDiscovering()是否允许被搜索
isEnabled() 是否打开
setName() 设置名字
startDiscovery()开始搜索
扫一扫在手机打开
评论
已有0条评论
0/150
提交
热门评论
相关推荐