Open luispereira opened 7 years ago
I too have the same question. Along with that I would also want to know whether is it possible to get the list of all the client devices not only connected to the hotspot but also available within hotspot range.
Hi @ParagRKadam, until now I could only see that there is a file which is updated with all the clients, but is not 100% updated (meaning that might exists clients on the file which are no longer connected). This file does not require any additional permission to access it. This file is a on
/proc/net/arp
.
There is also another file, which is available for rooted devices which is updated every time a client connects and disconnects on /data/misc/dhcp/dnsmasq.leases
If you want to get the list of connected clients then you should use this library ->
https://github.com/nickrussler/Android-Wifi-Hotspot-Manager-Class
/proc/net/arp
has the list all the current and previous clients as you said hence it does not suit my usecase and root is not an option hence i cannot use the file /data/misc/dhcp/dnsmasq.leases
.
Hi @ParagRKadam, you cannot know clients in range which are not connected. However, you can force all connected clients to respond by udp wifi broadcast.
Hi, I was wondering if it is possible to know when a client is connected to the hotspot, by a listener or a broadcast.