Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] mac = NetworkInterface.getNetworkInterfaces().nextElement().getHardwareAddress();
- String macAddress = "";
- for (int i = 0; i < mac.length; i++) {
- macAddress += String.format("%02X%s", mac[i], (i < mac.length - 1) ? ":" : "");
- }
- WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
- WifiInfo info = manager.getConnectionInfo();
- String macAddress = info.getMacAddress();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement