返回
顶部

修改密码

Android蓝牙主要类及功能

+1

-1

收藏

+1

-1

点赞0

评论0

蓝牙涉及到的主要类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
提交
热门评论
相关推荐
Android蓝牙开发
  • 近场通信
  • 2022-05-20 18:30
  • 5 0 0
+1
android 蓝牙分析
  • 近场通信
  • 2022-05-20 18:30
  • 10 0 0
+1
android4.0蓝牙使能的详细解析
  • 近场通信
  • 2022-05-20 18:30
  • 2 0 0
+1
Android 蓝牙API 之 BluetoothAdapter 类
  • 近场通信
  • 2022-05-20 18:30
  • 1 0 0
+1
android蓝牙源码分析
  • 近场通信
  • 2022-05-20 18:30
  • 5 0 0
+1
今日要闻
换一批
热点排行