I need to check if the phone is near the router and for that I need to know the distance between the phone and the router
Asked
Active
Viewed 168 times
-1
-
Not an adb command, but you can build an app performing rtt measurements. But both, phone and router have to support that standard. Read more: https://developer.android.com/guide/topics/connectivity/wifi-rtt – Christopher Apr 03 '20 at 16:37
2 Answers
0
I don think that's posible. Maybe what you can do is check the wifi signal I guess..

angelCanales
- 59
- 5
-
-
This was anwered here. [Getting WiFi signal strength in Android](https://stackoverflow.com/a/18538011/3285083) – angelCanales Aug 14 '19 at 01:04
0
IF you have a form of GPS enabled on both devices (phone and router) then you can check this. Otherwise you can check for signal strength, which will normally return a dB rating. However due to the variety of materials around and between the devices, it is nearly impossible to do programmatically without Positioning Coordinates.
To do this using Android (similar to Java) systems you would use WifiManager -> calculateSignalLevel(int)
link: https://developer.android.com/reference/android/net/wifi/WifiManager#calculateSignalLevel(int)