Created
May 8, 2013 14:15
-
-
Save mcatta/5540726 to your computer and use it in GitHub Desktop.
Android getMacAddress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getMacAddress(Activity activity) { | |
WifiManager wifiMan = (WifiManager) activity.getSystemService(Context.WIFI_SERVICE); | |
WifiInfo wifiInf = wifiMan.getConnectionInfo(); | |
return wifiInf.getMacAddress(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment