Partager via


WifiAwareNetworkSpecifier.Builder Constructors

Definition

Overloads

WifiAwareNetworkSpecifier.Builder(PublishDiscoverySession)

Create a builder for WifiAwareNetworkSpecifier used in requests to set up a Wi-Fi Aware connection.

WifiAwareNetworkSpecifier.Builder(DiscoverySession, PeerHandle)

Create a builder for WifiAwareNetworkSpecifier used in requests to set up a Wi-Fi Aware connection with a specific peer.

WifiAwareNetworkSpecifier.Builder(PublishDiscoverySession)

Create a builder for WifiAwareNetworkSpecifier used in requests to set up a Wi-Fi Aware connection.

[Android.Runtime.Register(".ctor", "(Landroid/net/wifi/aware/PublishDiscoverySession;)V", "", ApiSince=31)]
public Builder (Android.Net.Wifi.Aware.PublishDiscoverySession publishDiscoverySession);
[<Android.Runtime.Register(".ctor", "(Landroid/net/wifi/aware/PublishDiscoverySession;)V", "", ApiSince=31)>]
new Android.Net.Wifi.Aware.WifiAwareNetworkSpecifier.Builder : Android.Net.Wifi.Aware.PublishDiscoverySession -> Android.Net.Wifi.Aware.WifiAwareNetworkSpecifier.Builder

Parameters

publishDiscoverySession
PublishDiscoverySession
Attributes

Remarks

Create a builder for WifiAwareNetworkSpecifier used in requests to set up a Wi-Fi Aware connection. This configuration allows connections to any peers or to multiple peers (as opposed to only a specific peer with #Builder(DiscoverySession, PeerHandle)).

Multiple connections can be triggered by this configuration and using a single request via ConnectivityManager#requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback) and similar methods. Each successful connection will be signaled via the standard Connectivity Manager mechanisms - ConnectivityManager.NetworkCallback#onAvailable(Network). Calling ConnectivityManager#unregisterNetworkCallback(ConnectivityManager.NetworkCallback) will terminate all connections.

Java documentation for android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder.WifiAwareNetworkSpecifier$Builder(android.net.wifi.aware.PublishDiscoverySession).

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

WifiAwareNetworkSpecifier.Builder(DiscoverySession, PeerHandle)

Create a builder for WifiAwareNetworkSpecifier used in requests to set up a Wi-Fi Aware connection with a specific peer.

[Android.Runtime.Register(".ctor", "(Landroid/net/wifi/aware/DiscoverySession;Landroid/net/wifi/aware/PeerHandle;)V", "", ApiSince=29)]
public Builder (Android.Net.Wifi.Aware.DiscoverySession discoverySession, Android.Net.Wifi.Aware.PeerHandle peerHandle);
[<Android.Runtime.Register(".ctor", "(Landroid/net/wifi/aware/DiscoverySession;Landroid/net/wifi/aware/PeerHandle;)V", "", ApiSince=29)>]
new Android.Net.Wifi.Aware.WifiAwareNetworkSpecifier.Builder : Android.Net.Wifi.Aware.DiscoverySession * Android.Net.Wifi.Aware.PeerHandle -> Android.Net.Wifi.Aware.WifiAwareNetworkSpecifier.Builder

Parameters

discoverySession
DiscoverySession

A Wi-Fi Aware discovery session in whose context the connection is created.

peerHandle
PeerHandle

The handle of the peer to which the Wi-Fi Aware connection is requested. The peer is discovered through Wi-Fi Aware discovery. The handle can be obtained through DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], java.util.List) or DiscoverySessionCallback#onMessageReceived(PeerHandle, byte[]).

Attributes

Remarks

Create a builder for WifiAwareNetworkSpecifier used in requests to set up a Wi-Fi Aware connection with a specific peer.

To set up a connection to any peer or to multiple peers use #Builder(PublishDiscoverySession).

Java documentation for android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder.WifiAwareNetworkSpecifier$Builder(android.net.wifi.aware.DiscoverySession, android.net.wifi.aware.PeerHandle).

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