Frage

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 ..

War es hilfreich?

Lösung

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.

Andere Tipps

These nearby devices must send some signal, which your device can receive in order to detect them. Normally they dont do that I think. But if you can install an app on the other devices, this app could send a broadcast signal, which your device can pick up.

If there is no standard signal, for which you can listen, it becomes difficult. You have to build some kind of network sniffer.

A sniffer is the process of reading a direct port, in this case the listening port wifi. Read a port means pointing to a specified address and read the same buffer. This process is at low level, you must do it in pure C and compile in NDK. If you know of these issues is complicated.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top