DevicePolicyManager.GetWifiMacAddress(ComponentName) Method

Definition

Called by a device owner or profile owner on organization-owned device to get the MAC address of the Wi-Fi device.

[Android.Runtime.Register("getWifiMacAddress", "(Landroid/content/ComponentName;)Ljava/lang/String;", "GetGetWifiMacAddress_Landroid_content_ComponentName_Handler", ApiSince=24)]
public virtual string? GetWifiMacAddress (Android.Content.ComponentName? admin);
[<Android.Runtime.Register("getWifiMacAddress", "(Landroid/content/ComponentName;)Ljava/lang/String;", "GetGetWifiMacAddress_Landroid_content_ComponentName_Handler", ApiSince=24)>]
abstract member GetWifiMacAddress : Android.Content.ComponentName -> string
override this.GetWifiMacAddress : Android.Content.ComponentName -> string

Parameters

admin
ComponentName

Which admin this request is associated with. Null if the caller is not a device admin

Returns

the MAC address of the Wi-Fi device, or null when the information is not available. (For example, Wi-Fi hasn't been enabled, or the device doesn't support Wi-Fi.) <p> The address will be in the XX:XX:XX:XX:XX:XX format.

Attributes

Remarks

Called by a device owner or profile owner on organization-owned device to get the MAC address of the Wi-Fi device.

NOTE: The MAC address returned here should only be used for inventory management and is not likely to be the MAC address used by the device to connect to Wi-Fi networks: MAC addresses used for scanning and connecting to Wi-Fi networks are randomized by default. To get the randomized MAC address used, call android.net.wifi.WifiConfiguration#getRandomizedMacAddress.

Java documentation for android.app.admin.DevicePolicyManager.getWifiMacAddress(android.content.ComponentName).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to