Android Programming Press on the image to return to the main documentation page.

WifiDirect

List of types:

WifiDevice
WifiManager

WifiDevice

Represents a discovered wifi device.

Events:

None

Members:


  IsInitialized As Boolean

  MacAddress As String [read only]

  Name As String [read only]

Members description:

IsInitialized As Boolean
MacAddress As String [read only]
Returns the device MAC address.
Name As String [read only]
Returns the device name.

WifiManager

Allows you to connect two devices over a Wifi Direct connection.
See this tutorial for more information.

Permissions:

android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.CHANGE_NETWORK_STATE
android.permission.INTERNET
android.permission.ACCESS_NETWORK_STATE

Events:

EnabledChanged (Enabled As Boolean)
PeersDiscovered (Success As Boolean, Devices As List)
ConnectionChanged (Connected As Boolean, GroupOwnerIp As String)

Members:


  CancelConnections

  Connect (MacAddress As String)

  Connect2 (MacAddress As String, GroupOwner As Boolean)

  DiscoverPeers

  GetCurrentStatus

  Initialize (EventName As String)

  StopDiscovery

Members description:

CancelConnections
Cancels a connection process.
Connect (MacAddress As String)
Starts a connection process to the given address. The ConnectionChanged event will be raised.
Connect2 (MacAddress As String, GroupOwner As Boolean)
Similar to Connect. Setting the GroupOwner to True will ask the system to set the current device as the group owner.
DiscoverPeers
Starts a discovery process. The PeersDiscovered event will be later raised.
GetCurrentStatus
Calling this method will call the EnabledChanged and ConnectedChanged events to be raised with the last information.
Initialize (EventName As String)
Initializes the object. The EnabledChanged and ConnectionChanged events will be raised after this call.
StopDiscovery
Stops a discovery process.
Top