androidandroid-wifiandroid-wireless

Is it possible to scan for all the WiFi enabled android devices, not just hotspots?


i have been trying to develop to an app that scans for nearby WiFi devices. I found lots of similar apps in the market, but they scan only for nearby hotspots(access points). Is it possible to scan and find devices that have just turned WiFi alone ON.

If so please say me how to (the code snippet) .. thanks in advance ..


Solution

  • There are 2 parts to the answer.

    1. Most WiFi devices can operate in AP mode (if proper software installed) and in this case they will appear as a normal AP to anyone scanning around.
    2. If you want to find other WiFi devices that aren't in AP mode you'll need to switch your device to promiscuous (sniffer) mode. This needs to be supported by your device driver/firmware. Operation in sniffer mode causes the device to indicate all packets in the air, including those that aren't addressed to you. If your device supports this op mode, you'll need to instruct it by sending relevant command(s) - that's a proprietary interface that varies per device SW vendor.