Android.Net.Wifi.P2p.WifiP2pManager.Connect Method
Start a p2p connection to a device with the specified configuration.

Syntax

[Android.Runtime.Register("connect", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/p2p/WifiP2pConfig;Landroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V", "GetConnect_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Landroid_net_wifi_p2p_WifiP2pConfig_Landroid_net_wifi_p2p_WifiP2pManager_ActionListener_Handler")]
public virtual void Connect (WifiP2pManager.Channel c, WifiP2pConfig config, WifiP2pManager.IActionListener listener)

Parameters

c
is the channel created at WifiP2pManager.Initialize(Android.Content.Context, Android.OS.Looper, Android.OS.Looper)
config
options as described in Android.Net.Wifi.P2p.WifiP2pConfig class
listener
for callbacks on success or failure. Can be null.

Remarks

Start a p2p connection to a device with the specified configuration.

The function call immediately returns after sending a connection request to the framework. The application is notified of a success or failure to initiate connect through listener callbacks NoType:android/net/wifi/p2p/WifiP2pManager$ActionListener;Href=../../../../../reference/android/net/wifi/p2p/WifiP2pManager.ActionListener.html#onSuccess() or NoType:android/net/wifi/p2p/WifiP2pManager$ActionListener;Href=../../../../../reference/android/net/wifi/p2p/WifiP2pManager.ActionListener.html#onFailure(int).

Register for WifiP2pManager.WifiP2pConnectionChangedAction intent to determine when the framework notifies of a change in connectivity.

If the current device is not part of a p2p group, a connect request initiates a group negotiation with the peer.

If the current device is part of an existing p2p group or has created a p2p group with WifiP2pManager.CreateGroup(.Channel, .IActionListener), an invitation to join the group is sent to the peer device.

[Android Documentation]

Requirements

Namespace: Android.Net.Wifi.P2p
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14