Android Question Wifi connection event

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi all!
Is there a way to get an intent only when wifi connect/disconnect event is handled?

I tried android.net.conn.CONNECTIVITY_CHANGE action intent, and this works, but it is handled also when mobile data is actived/disactived
I tried also android.net.wifi.supplicant.CONNECTION_CHANGE, but is handled two times when wifi disconnect and is not handled when wifi is connected..

Last action i tried is android.net.wifi.STATE_CHANGE, but using the following code in manifest service is called many times. I have intent extra that send the state, so i can filter the state, but i want to know if is possibile to filter in manifest, in order to avoid call of service

B4X:
AddReceiverText(SendNotification,
<intent-filter>
<action android:name="android.net.wifi.STATE_CHANGE"/>
</intent-filter>)

Many thanks, i hope i clearly explained
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
In fact connection is changing status frequently. I have a wi-fi router which can log wi-fi events and it writes a lot of them.
Yes, there are some status when a connection is established
DISCONNECTED/DISCONNECTED with bssid
DISCONNECTED/DISCONNECTED
CONNECTING/AUTHENTICATING
CONNECTING/OBTAINING_IPADDR
CONNECTED/CONNECTED
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…