WifiP2pManager.RequestDeviceInfo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Request Device Info
[Android.Runtime.Register("requestDeviceInfo", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/p2p/WifiP2pManager$DeviceInfoListener;)V", "GetRequestDeviceInfo_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Landroid_net_wifi_p2p_WifiP2pManager_DeviceInfoListener_Handler", ApiSince=29)]
public virtual void RequestDeviceInfo(Android.Net.Wifi.P2p.WifiP2pManager.Channel c, Android.Net.Wifi.P2p.WifiP2pManager.IDeviceInfoListener listener);
[<Android.Runtime.Register("requestDeviceInfo", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/p2p/WifiP2pManager$DeviceInfoListener;)V", "GetRequestDeviceInfo_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Landroid_net_wifi_p2p_WifiP2pManager_DeviceInfoListener_Handler", ApiSince=29)>]
abstract member RequestDeviceInfo : Android.Net.Wifi.P2p.WifiP2pManager.Channel * Android.Net.Wifi.P2p.WifiP2pManager.IDeviceInfoListener -> unit
override this.RequestDeviceInfo : Android.Net.Wifi.P2p.WifiP2pManager.Channel * Android.Net.Wifi.P2p.WifiP2pManager.IDeviceInfoListener -> unit
Parameters
The channel created by Initialize(Context, Looper, WifiP2pManager+IChannelListener). This value cannot be null.
- listener
- WifiP2pManager.IDeviceInfoListener
for the callback that receives device information. This value cannot be null.
- Attributes
Remarks
Request Device Info
This method provides the device info in the form of a WifiP2pDevice. Valid WifiP2pDevice is returned when p2p is enabled. To get information notifications on P2P getting enabled refers WifiP2pStateEnabled.
This WifiP2pDevice is returned using the WifiP2pManager.IDeviceInfoListener listener.
DeviceAddress is only available if the caller holds the android.permission.LOCAL_MAC_ADDRESS permission, and holds the anonymized MAC address (02:00:00:00:00:00) otherwise.
This information is also included in the WifiP2pThisDeviceChangedAction broadcast event with extra ExtraWifiP2pDevice.
On Android 13 (API level 33) or later, if the app targets API level 33 or later, it needs android.permission.NEARBY_WIFI_DEVICES. If the app does not declare android:usesPermissionFlags="neverForLocation" for that permission, it also needs android.permission.ACCESS_FINE_LOCATION. On earlier Android versions, or if the app targets an earlier API level, it needs android.permission.ACCESS_FINE_LOCATION.
Android reference for android.net.wifi.p2p.WifiP2pManager.requestDeviceInfo.
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.