How to use wifi aware

Asked on 06/14/2025

1 search

To use Wi-Fi Aware, you can follow these steps as outlined in the session "Supercharge device connectivity with Wi-Fi Aware":

  1. Overview: Wi-Fi Aware enables direct device-to-device communication without relying on routers or central servers. It allows for dynamic, on-demand connections that are secure and can coexist with regular Wi-Fi connections. This is ideal for local experiences like file sharing or accessory setup. Supercharge device connectivity with Wi-Fi Aware (01:01)

  2. Pairing Devices: Pairing is a one-time setup process that establishes trust and facilitates secure communication. Your app can trigger the pairing flow using system APIs to show the Pairing UI. The user selects a device and authorizes the pairing by entering a PIN code. Once paired, your app can securely reconnect to the device whenever it's in proximity. Supercharge device connectivity with Wi-Fi Aware (07:46)

  3. Connecting Devices: After pairing, your app can establish connections with paired devices. One device publishes a service and listens for connections, while the other subscribes and browses for devices to connect to. Use the Network Connection API to start connections to the desired endpoint. Supercharge device connectivity with Wi-Fi Aware (15:05)

  4. Optimizing Performance: You can optimize connection performance by balancing throughput, latency, and power consumption. The system applies reasonable defaults, but you can adjust parameters like performance mode and traffic service class if needed. Supercharge device connectivity with Wi-Fi Aware (19:01)

These steps provide a high-level guide to using Wi-Fi Aware in your app, enabling seamless and secure device-to-device interactions.