i want to communicate to the server as soon as device connects to the wi-fi or mobile data. Currently i am using broadcast receiver to notify when devices connects to wifi code is below:
<receiver android:name="com.example.rup35h.WifiReceiver" >
<intent-filter android:priority="100" >
<action android:name="android.net.wifi.STATE_CHANGE" />
</intent-filter>
</receiver>
My concern is will it work when device will connect to mobile data. will this also get called when user will turn on the mobile data/3G network.
Please let me know if any one will have something related to this. Thanks in advance.