android - 在 Android 上禁用 "Bluetooth Permission Request"确认 - 使用 ACTION_REQUEST_DISCOVERABLE

标签 android bluetooth broadcast discovery

我正在尝试将我的 Android 手机作为蓝牙服务器广播,为此,我首先想让 Android“可发现”。

我正在使用 ACTION_REQUEST_DISCOVERABLE 这样做,如下所示: http://developer.android.com/guide/topics/wireless/bluetooth.html#EnablingDiscoverability

 testIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
 startActivity(testIntent);

不幸的是,这还会在手机上弹出“蓝牙权限请求”对话框。

有没有办法让我的手机“可发现”,而无需提示用户?

谢谢!

最佳答案

尝试在您的应用程序中包含 BLUETOOTH_ADMIN 权限

关于android - 在 Android 上禁用 "Bluetooth Permission Request"确认 - 使用 ACTION_REQUEST_DISCOVERABLE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6669245/

相关文章:

android - 如何仅在wifi上向android中的服务器发送数据

swift3 - 如何以编程方式在 iOS 11 中打开蓝牙设置

local - CUPS @LOCAL 值

android sdk获取广播自动续订订阅

c - 为什么有些线程没有收到 pthread_cond_broadcast?

android - 在 Fragment 上显示来自 url 的图像

android - 在 Android 中显示一个透明的 Activity?

安卓NDK : Why is this malloc() having no observable effect?

android - 使用带有 android 的手持式蓝牙打印机

ios - 在 UITableView 中显示可用的蓝牙列表