Android Question Smartphone location with WIFI strong

pazzokli

Active Member
Licensed User
Longtime User
Hi all,
is possible calculate signal strong of wifi (connected an not) in order to understand where smartphone is located?
Not with precision, but for example router is placed at first floor, and I would know if I on the same floor of the router or not reading its signal strong
Possible?
Further I can improve precision using more wifi source

Thanks
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
It depends what you mean by "Not with precision ...". I know that in my own house the wifi signal from the room above, through a wooden floor and plasterboard ceiling, is stronger that the signal from an adjacent room through a brick wall. Maybe the wifi in the room above is also a foot or two closer. But is this information telling you what you need to know about "where the smartphone is located".
 
Upvote 0

Knoppi

Active Member
Licensed User
Longtime User
i used this code in my old wifi app from 2015
B4X:
Public Sub GetDistance( Level As Int, Frequency As Int) As Int
    Return Power(10, (27.55 - (20* Logarithm( Frequency, 10)) + Abs( Level)) / 20)
End Sub
 
Upvote 0

pazzokli

Active Member
Licensed User
Longtime User
i used this code in my old wifi app from 2015
B4X:
Public Sub GetDistance( Level As Int, Frequency As Int) As Int
    Return Power(10, (27.55 - (20* Logarithm( Frequency, 10)) + Abs( Level)) / 20)
End Sub
Where do you find Level and Frequency?
Did you use a dedicated library?
 
Upvote 0

pazzokli

Active Member
Licensed User
Longtime User
It depends what you mean by "Not with precision ...". I know that in my own house the wifi signal from the room above, through a wooden floor and plasterboard ceiling, is stronger that the signal from an adjacent room through a brick wall. Maybe the wifi in the room above is also a foot or two closer. But is this information telling you what you need to know about "where the smartphone is located".
I need only know at witch floor I'm located, so app show me right options
 
Upvote 0

Knoppi

Active Member
Licensed User
Longtime User
the old Library ABWiFi only works up to api 28
if you want to work with api > 28 then check out this link
https://www.b4x.com/android/forum/threads/access-wifi-information.117901/
you need this
B4X:
    Wait For( GetWifiInfo) Complete (WifiInfo As JavaObject)
    If WifiInfo.IsInitialized Then
        Log( "getFrequency: "& WifiInfo.RunMethod("getFrequency", Null))
        Log( "getRssi: "& WifiInfo.RunMethod("getRssi", Null))  ' is LEVEL
    End If
 
Upvote 0
Top