I am using the following code:
WifiManager wifiMgr = (WifiManager) app.getSystemService(Context.WIFI_SERVICE);
return wifiMgr.getConnectionInfo().getMacAddre
You can't. Depending on the device, if the wifi adapter is disabled then it may actually be electronically switched off, so you can't read any info from it.
From the Android Developers Blog:
Mac Address
It may be possible to retrieve a Mac address from a device’s WiFi or Bluetooth hardware. We do not recommend using this as a unique identifier. To start with, not all devices have WiFi. Also, if the WiFi is not turned on, the hardware may not report the Mac address.
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
String mac = wm.getConnectionInfo().getMacAddress();