android 蓝牙技术 学习记录 二

android 蓝牙连接 关键类

BluetoothDevice--------------------蓝牙设备

BluetoothGattCallback--------------连接回调

BluetoothGatt----------------------gatt

  1. public BluetoothGatt connectGatt(Context context, boolean autoConnect,

BluetoothGattCallback callback) ;

2.public BluetoothGatt connectGatt(Context context, boolean autoConnect,

BluetoothGattCallback callback, int transport) ;

3.public BluetoothGatt connect Gatt(Context context, boolean autoConnect,

BluetoothGattCallback callback, int transport, int phy) ;

4.public BluetoothGatt connectGatt(Context context, boolean autoConnect,

BluetoothGattCallback callback, int transport, int phy,

Handler handler) ;

5.public BluetoothGatt connectGatt(Context context, boolean autoConnect,

BluetoothGattCallback callback, int transport, boolean opportunistic, int phy, Handler handler) ; *

----autoConnect 是否自动连接参数。

----transport 是否低功耗。

-----phy。 物理层;

相关推荐
我命由我123457 小时前
Bugly - Bugly 基本使用( App 质量追踪平台)
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
weiggle8 小时前
第二篇:搭建你的第一个 Compose 项目——开发环境与项目结构
android·前端
阿巴斯甜8 小时前
为什么 AIDL 接口客户端、服务端要写两份一模一样的?
android
weiggle9 小时前
第一篇:Jetpack Compose 宣言——为什么 Android 开发需要声明式 UI
android
城管不管11 小时前
什么是Prompt?
android·java·数据库·语言模型·llm·prompt
weiggle11 小时前
Jetpack Compose 重组机制与性能优化深度剖析
android
●VON11 小时前
鸿蒙Flutter实战:24小时新建标签提示组件
android·flutter·华为·harmonyos·鸿蒙
2501_9160074712 小时前
iOS应用性能优化全面指南:从内存管理到工具使用
android·ios·性能优化·小程序·uni-app·iphone·webview
程序员陆业聪12 小时前
WebView代理方案实现:拦截请求、注入资源与离线包架构
android
好好风格12 小时前
把一台 Root 安卓机交给 AI 智能体,会发生什么?
android·人工智能·开源