Android Question How can I capture WifiManager.RSSI_CHANGED_ACTION?

Paulo Rosa

Member
Licensed User
Hi all,

I'm working on a B4A project that monitors and shows the current Wi-Fi signal level.

I need to capture WifiManager.RSSI_CHANGED_ACTION.

I took a look at Phone Library, but it doesn't capture that event. PhoneEvents has only the event ConnectivityChanged, which is triggered only on changes like WiFi on/off and change of SSID.

Regards
 

Paulo Rosa

Member
Licensed User
Hi Erel,

Thanks, I have already considered it, but it's not the solution I need. I'm after a solution which gives me the WiFi signal strength on real time. Let me explain...

I have four WiFi access points in my house: one router and three WiFi repeaters. It happens that Android's WiFi search algorithm is far from ideal, since it tends to choose the last used saved WiFi AP, while it would be smarter if it always chose the AP with the strongest signal. In many situations, I'm sitting just beside an WiFi repeater and my phone remains connected to a far away AP. Obviously, if my phone were connected to the nearer (stronger signal) AP, it's WiFi connection speed would be better.

I have already have the solution working as an app. For that, I used Phone library, to capture the PhoneEvent ConnectivityChanged; MLWiFi library, to read MLWiFi.WiFiSignal; and BroadcastReceiver libray, to capture android.net.wifi.RSSI_CHANGED.

The app is working fine, since it changes the WiFi sinal meter whenever the WiFi icon at Android's status bar changes.

According to https://stackoverflow.com/questions/44018447/very-slow-reaction-rssi-changed-action,

the event android.net.wifi.RSSI_CHANGED is not constantly triggered. Instead, it is triggered only when the WiFi strength changes by a certain amount.

Currently I'm working on doing the same solution as a widget, and I must say I'm having trouble doing that. I don't fully understand yet how to implement widgets, I have to work on that...

Regards,
 
Last edited:

Paulo Rosa

Member
Licensed User
This event will not help you. It is very inaccurate. It only raises an event when there is a change in the wifi icon in the status bar.
Well, it's working OK for me. Upon starting, my app shows the same WiFi level as the Android's icon at the status bar. While I walk through my house, my app's WiFi meter changes synchronously with the icon at the status bar. So, it's looks like it's OK .
 

Paulo Rosa

Member
Licensed User
Adding to my last post...

That's what exactly what I was looking for. I really didn't want to precisely show the current WiFi signal strength, I wanted to follow the WiFi icon in the status bar.

That way, I have a better way of choosing the AP my phone is connected, since my app informs the signal level and the AP name.
 
Top