【问题标题】:How to get mobile bluetooth MAC address programmatically in oreo如何在 oreo 中以编程方式获取移动蓝牙 MAC 地址
【发布时间】:2018-06-12 23:20:38
【问题描述】:

我正在尝试以编程方式获取移动蓝牙 mac id。我看到了一些链接,我得到了这个 coce。

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

到牛轧糖为止,这段代码运行良好。但我在 OREO(8.0.0) 中得到了 null,并且我在清单文件中授予了权限。

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

那么有没有办法在OREO中获取蓝牙mac地址?

【问题讨论】:

    标签: android bluetooth bluetooth-lowenergy core-bluetooth


    【解决方案1】:

    蓝牙 mac 地址仅适用于 Android Oreo 中的系统应用。详情请查看this 答案。此外,您还可以阅读this 文章了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-25
      • 2014-10-28
      • 2022-06-13
      • 1970-01-01
      • 2023-03-27
      • 2016-01-27
      • 2013-01-27
      • 1970-01-01
      相关资源
      最近更新 更多