Provides classes to create peer-to-peer (P2P) connections with Wi-Fi Direct.

Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi Direct, then communicate over a speedy connection across distances much longer than a Bluetooth connection. The primary class you need to work with is {@link android.net.wifi.p2p.WifiP2pManager}, which you can acquire by calling {@link android.app.Activity#getSystemService getSystemService(WIFI_P2P_SERVICE)}. The {@link android.net.wifi.p2p.WifiP2pManager} includes APIs that allow you to:

Several other interfaces and classes are necessary as well, such as:

In order to use the Wi-Fi P2P APIs, your app must request the following user permissions:

For example code, see the Wi-Fi Direct Demo sample application.

Note: Not all Android-powered devices support Wi-Fi Direct. If your application uses Wi-Fi Direct, declare so with a {@code } element in the manifest file:

<manifest ...>
    <uses-feature android:name="android.hardware.wifi.direct" />
    ...
</manifest>