Can my Android app find the MAC address of the Wifi access point it is connected to?
The docs for android.net.wifi.WifiInfo getMacAddress() don't provide any details.
See http://developer.android.com/reference/android/net/wifi/WifiInfo.html#getMacAddress().
I'm assuming this is the Mac address of my phone. Can I find the Mac address of the access point?
The MAC address of your access point is listed on the stickerlocated on the bottom of the access point. It is listed below theserial number. The LAN/Wireless and WAN MAC address can be obtained by logginginto the web-based configuration of the router.
What is a MAC address? For those that might not know, a MAC (Media Access Control) address is a unique identifier, assigned to a device's network interface controller. This address can be used to track a device on Wi-Fi networks.
getBSSID()
of WifiInfo
class will return MAC address of remote access point.
BSSID
explained here.
The following method will return the MAC address of the access point, null if there is no network currently connected.
public String getMacId() { WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); return wifiInfo.getBSSID(); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With