以编程方式接受配对请求-Android蓝牙 [英] Accept pairing request programmatically - Android Bluetooth

查看:117
本文介绍了以编程方式接受配对请求-Android蓝牙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

远程设备正在向我的应用程序发送配对请求,并且需要输入用于配对的密码(会出现一个对话框,要求输入密码).我有密码,我想编写一个程序,可以将密码提供给配对请求.

A remote device is sending my application a pairing request and it requires a pin to be entered for pairing (A dialog appears and asks for pin). I have the pin and I want to write a program that could provide the pin to the pairing request.

有人可以告诉我如何在程序中接受配对请求,但不显示要求用户输入密码的对话框.

Can someone please tell me how to accept the pairing request in a program and somehow not show the dialog asking user to enter the pin.

推荐答案

自Android 2.3.3起,有以下方法:

Since Android 2.3.3 there are the methods:

createInsecureRfcommSocketToServiceRecord()

和:

listenUsingInsecureRfcommWithServiceRecord()

在BluetoothAdapter中.

in the BluetoothAdapter.

这篇关于以编程方式接受配对请求-Android蓝牙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆