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

问题描述 投票:0回答:0

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

 String macAddress = android.provider.Settings.Secure.getString(getApplicationContext().getContentResolver(), "bluetooth_address");

但是,以上代码在 Android Oreo 和 Pie 中不再有效。

有人解决这个问题吗?

android bluetooth mac-address
© www.soinside.com 2019 - 2024. All rights reserved.