-1

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

  • 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 Answers2

0

I don think that's posible. Maybe what you can do is check the wifi signal I guess..

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)