Find Android devices in Wifi network

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
bichlepa
Posts: 148
Joined: 04 Mar 2014 18:29
Location: Germany
Contact:

Find Android devices in Wifi network

Post by bichlepa » 27 Mar 2014 07:47

Is it possible to find Android devices in a Wifi network?

I thought it might be possible with a broadcast address, but it doesn't work.
I get an answer if I open http://192.168.1.101:8080/wotablet. But not http://192.168.1.255:8080/wotablet. Trying out all possible IP addresses is not practicable because it takes several seconds before the answer comes that the page is not reachable.

I'm about to create a solution to exchange the clipboard between the computer and an android device. It works but only if I know the IP Address of the android device.

ZSasha
Posts: 103
Joined: 11 Oct 2013 03:48

Re: Find Android devices in Wifi network

Post by ZSasha » 27 Mar 2014 20:17

how about using an external place (like dropbox or gdrive) so Android, once your flow has been started started, would "register" itself by putting its own IP address in a text file.
Then PC app could query the same location, read the file to get Android's IP address and then try to contact that address directly?

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Find Android devices in Wifi network

Post by Bluscre » 27 Aug 2019 18:34

This would indeed be nice,

Btw @martin why is stopfli.com a thing?
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Find Android devices in Wifi network

Post by Martin » 27 Aug 2019 19:11

Hi,

You can ignore the stopfli-site. It was temporarily used for a few tests and I forgot to remove it. It should stop working soon...

Regards,
Martin

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Find Android devices in Wifi network

Post by Bluscre » 27 Aug 2019 19:20

I use this now (works without root on my device:

Code: Select all

// Execute Command: cat /proc/net/arp

stdout = split(stdout, "\n");
header = removeElement(stdout, 0);
wifi_devices = newMap();
for (i in stdout)
{
   split = split(i, "\\s+");
   ip = split[0];
   wifi_devices[ip] = newMapFromValues(
   "type", split[1],
   "flags", split[2],
   "mac", split[3],
   "mask", split[4],
   "adapter", split[5]
   );
}
Thanks for the info martin, i almost thought i entered my login on a scam site for a second xd
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Find Android devices in Wifi network

Post by Desmanto » 29 Aug 2019 19:05

But arp only contain the devices address that have communicate to our phone within last several minutes. And sometimes it doesn't even have the devices address I just ping.

Still have to use ping to all possible address and parse the result to grep only for the reply one.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply