Reputation: 4255
What is the main difference between the WiFi aware and WiFi P2P technologies?
Using WiFi P2P you can establish a connection between two or more nearby devices without the need of common network. But the android docs spec also that
Wi-Fi Aware capabilities enable devices running Android 8.0 (API level 26) and higher to discover and connect directly to each other without any other type of connectivity between them.
What is the difference between them?
Upvotes: 18
Views: 7141
Reputation: 2996
Based on the Android docs, with Wi-Fi Aware, you can send data (lightweight only! max of 255 bytes) between the devices during service discovery phase and when needed, you may open a connection between the devices to send larger data. With Wi-Fi peer-to-peer, you have to perform some kind of authentication first and then open a socket before you can send data between the devices.
Here are the portions of the Wi-Fi aware overview where I got these information:
The Wi-Fi Aware APIs let apps perform the following operations:
- Discover other devices: [...] After the subscriber discovers a publisher, the subscriber can either send a short message or establish a network connection with the discovered device.
- Create a network connection: After two devices have discovered each other [...] they can create a bi-directional Wi-Fi Aware network connection without an access point.
Note: Messages are generally used for lightweight messaging, as they might not be delivered (or be delivered out-of-order or more than once) and are limited to about 255 bytes in length.
Additionally, with Wi-Fi Aware, developers have a choice between the methods createNetworkSpecifierOpen()
and createNetworkSpecifierPassphrase()
of the DiscoverySession
class to open unencrypted or encrypted connections, respectively, between the devices.
With Wi-Fi peer to peer, developers have no other choices other than the WifiP2PManager.connect()
method. Calling it will trigger a dialog box (Push Button Configuration) on the device being connected to and that dialog box will only appear when two devices connects to each other for the first time.
By the way... modifying the WpsInfo
of a WifiP2pConfig
is useless; it will always use the Push Button Configuration option. I tested it on the devices I have (Asus ZC520TL-Nougat, Asus ZE551ML-Marshmallow, Huawei Y5-Marshmallow, and Huawei T1-KitKat). The PBC dialog appeared even if the wifip2pconfig.wps.setup
is not equal to WpsInfo.PBC
. Feel free correct me if this isn't true for all devices because it might just be an OEM thing.
For more information visit Wi-Fi peer-to-peer overview.
Upvotes: 12
Reputation: 1998
Wi-Fi Aware is a similar peer-to-peer connectivity technology to Wi-Fi Direct. However, while Wi-Fi Direct requires a centralized coordinator, called a Group Owner, Wi-Fi Aware creates decentralized, dynamic peer-to-peer connections. Many applications, such as Miracast and direct printer connections, work well with Wi-Fi Direct. Wi-Fi Aware is positioned to provide peer-to-peer connectivity in highly mobile environments, where devices join or leave in a less deterministic manner. Whether it's professionals at a crowded conference to find each other or strangers on a subway momentarily joining a multi-player game, Wi-Fi Aware connections seamlessly adapt to changing environment and usage conditions.
Upvotes: 4
Reputation: 96
WiFi Aware is significantly faster at establishing a connection.
The discovery stage is much more flexible: you can add your own information (255 bytes) to your service announcements and exchange short messages (255 bytes) with other peers without needing to establish a connection.
However, all the connections in WiFi Aware are one-to-one. A device can only have a very limited number of simultaneous connections (two, in the case of the Pixel 2).
For comparison, WiFi P2P works more similarly to an automatic Hotspot: the devices negotiate among themselves which of them will create a WiFi network, and afterwards other devices can join in. If you manage to get the WiFi SSID/password, it is possible to join the network manually.
My understanding is that WiFi P2P has worse performance in terms of battery (at least in the case of the central node).
Upvotes: 5