Unfortunately there is no public API to give information about this...
But you can read /proc/net/arp file and see the clients connected to your Access Point.
/proc/net/arp file have 6 fields: IP address, HW type, Flags, HW address, Mask and Device
The problem is when a client get disconnected, because it doesn't disappear from the file. A solution may be to do ping to every client and wait for response, but for me this isn't a good solution because some clients don't respond to ping. If you like this solution check this project on GitHub --> https://github.com/nickrussler/Android-Wifi-Hotspot-Manager-Class/tree/master/src/com/whitebyte
What i have did is: read /proc/net/arp and check the FLAGS field, when the value is 0x2 the station is connected and 0x0 is disconnected, but to refresh this field I need to clear ARP cache from time to time, and i did it with this command: ip neigh flush all
I hope i helped you
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…