Get Bluetooth local mac address in Marshmallow

前端 未结 8 503
半阙折子戏
半阙折子戏 2020-11-29 06:23

Pre Marshmallow my app would obtain it\'s device MAC address via BluetoothAdapter.getDefaultAdapter().getAddress().

Now with Marshmallow Android is retu

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 06:53

    Access to the mac address has been deliberately removed:

    To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs.

    (from Android 6.0 Changes)

提交回复
热议问题