Sunday 24 June 2018

privacy - How to get the missing Wifi MAC Address in Android Marshmallow and later?

Android developers looking to get the Wifi MAC Address on Android M may have experienced an issue where the standard Android OS API to get the MAC Address returns a fake MAC Address (02:00:00:00:00:00) instead of the real value.



The normal way to get the Wifi MAC address is below:




final WifiManager wifiManager = (WifiManager) getApplication().getApplicationContext().getSystemService(Context.WIFI_SERVICE);

final String wifiMACaddress = wifiManager.getConnectionInfo().getMacAddress();

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...