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。 物理层;

相关推荐
前行的小黑炭3 小时前
Android 协程的使用:结合一个环境噪音检查功能的例子来玩玩
android·java·kotlin
阿华的代码王国3 小时前
【Android】内外部存储的读写
android·内外存储的读写
inmK16 小时前
蓝奏云官方版不好用?蓝云最后一版实测:轻量化 + 不限速(避更新坑) 蓝云、蓝奏云第三方安卓版、蓝云最后一版、蓝奏云无广告管理工具、安卓网盘轻量化 APP
android·工具·网盘工具
giaoho6 小时前
Android 热点开发的相关api总结
android
咖啡の猫8 小时前
Android开发-常用布局
android·gitee
程序员老刘9 小时前
Google突然“变脸“,2026年要给全球开发者上“紧箍咒“?
android·flutter·客户端
Tans59 小时前
Androidx Lifecycle 源码阅读笔记
android·android jetpack·源码阅读
雨白9 小时前
实现双向滑动的 ScalableImageView(下)
android
峥嵘life9 小时前
Android Studio新版本编译release版本apk实现
android·ide·android studio
studyForMokey11 小时前
【Android 消息机制】Handler
android