4

I am trying to get mobile blue-tooth mac id programmatically.i saw some link and i got this coce.

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

upto nougat this code is working fine.But i am getting null in OREO(8.0.0) and i gave permission in manifest file.

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

So is there a way to get the bluetooth mac address in OREO?

parik
  • 2,313
  • 12
  • 39
  • 67
Siddharthan
  • 61
  • 2
  • 9

1 Answers1

2

The blue-tooth mac address is only available to system apps in Android Oreo. Please check this answer for details. Moreover you can also read this article for more information.

Imtiaz Abir
  • 731
  • 7
  • 12