WifiAwareNetworkSpecifier.Builder Constructors
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.
Overloads
WifiAwareNetworkSpecifier.Builder(PublishDiscoverySession) |
Create a builder for |
WifiAwareNetworkSpecifier.Builder(DiscoverySession, PeerHandle) |
Create a builder for |
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.
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)
.
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.