I need to design an Android app that should display the MAC address of the device.. I have already done the following coding..
WifiManager wifimanager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo winfo = wifimanager.getConnectionInfo();
String MACAddress = winfo.getMACAdress();
But the problem is, this code is working only when wifi is turned on, but my requirement is to find the MAC address whether wifi is turned on or not.
Here is the code to getMac Address without using wifi manager.
Some android devices may not have wifi available or are using ethernet wiring. and call this method as per network available.
and do not forget to set manifest permission.