Reputation:
I am making an app to search devices connected to my Wifi modem.I am working on it for a while and there are quiet a few question's on the topic but nothing which answers my question.
I have been trying to find devices by using the ARP table,Inetaddress's isReachable command , and also using /system/bin/ping and it works "fine" but there are periods in which certain devices (especially mobile and tab's) go silent and not respond to any kind of contact we try to make using the above methods . This period of "silence" could last upto around a minute which is bad for my project .
I am using Java to code.I am not finding any other path forward on this . Any help is Appreciated .
Upvotes: 1
Views: 1531
Reputation: 641
What you describe is the normal behavior of an android system.
When a device is in lock mode (and not only) the OS, and as OS you should consider not only the android version but also any changes made by the device constructor, could pause/slow down various operations to conserve battery.
How aggressive is the pause/slow down can vary from device to device and from OS version to OS version. For example, version 6 of Android is more aggressive on preserve battery from former versions.
You have also to consider that the user has the possibility to close the wifi (via settings) when the screen goes off.
You have to deal with this as it is a prerequisite condition for your app.
Upvotes: 1