Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Broadcast Intent when network state has changend

Does Android broadcast an intent when the network state has changend, i.e. from GSM to Wifi? And if so what permission do I need and what is the intent action called?

like image 433
user283494 Avatar asked Apr 20 '10 14:04

user283494


2 Answers

Update: please use this instead: https://stackoverflow.com/a/2677519/241869

like image 142
velazcod Avatar answered Nov 15 '22 18:11

velazcod


There isn't anything exactly like what you are describing but you can use ConnectivityManager.CONNECTIVITY_ACTION to monitor changes and use the extras that come with it to see if the connection has changed from GSM to Wifi and vice versa. For this you need the permission android.permission.ACCESS_NETWORK_STATE and android.permission.ACCESS_WIFI_STATE for checking wifi information.

like image 35
Al. Avatar answered Nov 15 '22 17:11

Al.