android蓝牙自动配对的有关问题
来源:互联网 发布:java client 5.0 编辑:程序博客网 时间:2024/06/10 06:58
public class MessageReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
if (action.equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
try {
BtConnectOperation.BtSetPairingConfirmation(device.getClass(), device);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mConnService.pairEnd();
}
}
}
其中这个BtSetPairingConfirmation函数如下,使用反射机制
//设置确定
static public boolean BtSetPairingConfirmation(Class btClass, BluetoothDevice device)
throws Exception {
Method SetPairingConfirmationMethod = btClass.getMethod("setPairingConfirmation",
boolean.class);
Boolean returnValue = false;
returnValue = (Boolean)SetPairingConfirmationMethod.invoke(device, true);
return returnValue;
}
为何还是不能直接自动配对呢,还是会弹出“蓝牙配对申请”框,请大神们给些意见,谢谢啊
- android蓝牙自动配对的有关问题
- android 蓝牙自动配对问题
- android蓝牙自动配对
- Android 蓝牙自动配对
- Android下的蓝牙自动配对
- android 实现蓝牙自动配对连接
- 【转载】Android蓝牙自动配对Demo
- android源码灭屏时蓝牙自动配对
- android 取消蓝牙配对框 实现自动配对
- android 取消蓝牙配对框 实现自动配对
- Android 取消蓝牙配对框 实现自动配对
- android 取消蓝牙配对框 实现自动配对
- android 取消蓝牙配对框 实现自动配对
- Android蓝牙设备的配对,连接,搜索
- Android简单的蓝牙配对与连接
- Android Bluetooth 学习(3)蓝牙设备之间自动配对
- Android蓝牙实现自动配对,无需输入密码
- Android蓝牙自动配对和Pin码设置
- 启动报错1
- iTextSharp快速使用指南
- java的文件上传
- 一些兼容问题
- jquery速查表
- android蓝牙自动配对的有关问题
- 天仙配
- Activity经典实例:启动其他Activity并使用Bundle存储数组返回结果
- 想考清华?先来看看能不能吃得了清华的那份苦
- Spring in Action读书笔记 (一)
- JavaScript 数组对象获得input输入框的值,并设置
- hardware模块
- Struts2 环境的搭建及项目测试
- git 使用教程