Android Question SCAN CONNEDTED WiFi NETWORK

RockSmoke

Member
Hello again everyone. How do I view the devices on the connected network? The device to be viewed must be connected to the same wifi network.
Thanks in advance
 

drgottjr

Expert
Licensed User
Longtime User
forget it. security exception is thrown since android 9 or 10, i think.
in the old days you could run
B4X:
ph.Shell("cat", Array As String("/proc/net/arp"), stdout, stderr)
to see other hosts on the network. but android no like anymore
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
(almost) all the information you see with fing resides on the dhcp server. information pertaining to a given device's manufacturer can be obtained through a lookup table using the device's mac address.

a wifi scan from your device will only tell you about nearby access points, not about other hosts on the network. it is possible to scan for connected devices, but you will only see their ip addresses. the relation between ip address and device used to be available on the arp table. but android shut that down.

you have to formulate a special request (dhcpinform) to the dhcp server (presumably your router). you'll have to study up on making dhcp requests. then you can use b4a's datagram api. hopefully, you have a lot of free time.
 
Last edited:
Upvote 0
Top