0

I want to get my mac address on my android mobile, without using the Wi-fi or Bluetooth, programmatically in android.

How can I do this?

Draken
  • 3,134
  • 13
  • 34
  • 54
user3153156
  • 17
  • 1
  • 6

1 Answers1

0
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo wInfo = wifiManager.getConnectionInfo();
String macAddress = wInfo.getMacAddress(); 

Dont forget to add permission for ACCESS_WIFI_STATE

Sergi Juanola
  • 6,531
  • 8
  • 56
  • 93
subair_a
  • 1,028
  • 2
  • 14
  • 19
  • i want without wifi, For this i have to turn on wifi. – user3153156 May 08 '14 at 08:49
  • Read /sys/class/net/[something]/address as a text file Here is a same question asked before http://stackoverflow.com/questions/6191832/get-mac-address-of-android-device-without-wifi/15183653#comment21394080_15183653 – subair_a May 08 '14 at 09:25