Demonstrates how to use the WiFiDirectDevice class to find and connect to nearby Wi-Fi Direct devices.
You can use Wi-Fi Direct to both enumerate a list of Wi-Fi Direct devices within wireless range, and then set up a socket connection between apps using Wi-Fi Direct devices. The WiFiDirectDevice sample demonstrates how to use the Wi-Fi Direct API to get a list of Wi-Fi Direct devices within range, and then create a socket connection between your device and a device from the list.
You need to enable the Proximity capability in your app manifest file in order to use the Wi-Fi Direct API.
You can also create a connection between peer apps (your app installed on more than one peer device) using Wi-Fi Direct and the FindAllPeersAsync method in the Proximity API. For more information and example code, see the Proximity sample and Proximity and tapping.
To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.
To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.
Note For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.
Related topics
Operating system requirements
| Client | |
|---|---|
| Server |
Build the sample
- Start Visual Studio 2013 and select File > Open > Project/Solution.
- Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Visual Studio 2013 Solution (.sln) file.
- Press F7 or use Build > Build Solution to build the sample.
Run the sample
To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.