I am using WiFi MAC address as Unique id, from Marshmallow onwards returning fake MAC address(for security reason). With this my Android application behaves differently. How to get the actual MAC address of the Android device.
I am using the following code-snippet.
WifiManager wmgr = (WifiManager)getSystemService(Context.WIFI_SERVICE);
String wifiId = wmgr.getConnectionInfo().getMacAddress();
Following permissions are added in Manifest file.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />