Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.net.wifi.STATE_CHANGE or android.net.wifi.supplicant.CONNECTION_CHANGE

In android broadcasts, what's the difference between

 <action android:name="android.net.wifi.STATE_CHANGE"/>

and

 <action android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />
like image 360
Yesudass Moses Avatar asked Mar 06 '23 05:03

Yesudass Moses


2 Answers

STATE_CHANGE : Broadcast intent action indicating that the state of Wi-Fi connectivity has changed. An extra provides the new state in the form of a NetworkInfo object.

This is lookup key for an int that indicates whether Wi-Fi is enabled, disabled, enabling, disabling, or unknown.

CONNECTION_CHANGE : Broadcast intent action indicating that a connection to the supplicant has been established (and it is now possible to perform Wi-Fi operations) or the connection to the supplicant has been lost. One extra provides the connection state as a boolean, where true means CONNECTED.

This is a lookup key for a boolean that indicates whether a connection to the supplicant daemon has been gained or lost. {@code true} means a connection now exists.

P.S: SUPPLICANT_CONNECTION_CHANGE_ACTION is deprecated from API level P

like image 197
Masoom Badi Avatar answered Mar 08 '23 22:03

Masoom Badi


<action android:name="android.net.wifi.STATE_CHANGE"/>

Broadcast intent action indicating that the state of Wi-Fi connectivity has changed.

<action android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />

Broadcast intent action indicating that a connection to the supplicant has been established (and it is now possible to perform Wi-Fi operations) or the connection to the supplicant has been lost.

Note:

This constant was deprecated in API level P. This is no longer supported.

like image 34
Sagar Avatar answered Mar 08 '23 22:03

Sagar