小编use*_*331的帖子

如何以编程方式获取 android 8.1 及更高版本中的蓝牙 mac 地址?

我们有一个 Android 应用程序,我们需要以编程方式通过蓝牙在 2 个设备之间建立连接。

 String macAddress = android.provider.Settings.Secure.getString(getApplicationContext().getContentResolver(), "bluetooth_address");
Run Code Online (Sandbox Code Playgroud)

但是,上述代码在 Android Oreo 和 Pie 中不再起作用。

有人有解决此问题的方法吗?

android mac-address bluetooth programmatically

5
推荐指数
0
解决办法
552
查看次数