In Android there is a availability of different types of network that is 3g,EDGE,LTE etc. i am searching for the event when user network type change from EDGE to 3g,LTE and vice versa.
Asked
Active
Viewed 546 times
0
1 Answers
3
There is a broadcast receiver that will get called whenever network state changes(connection lost,changed,etc). In the receiver class you would have to figure out the kind of network network you are intrested in. The connectivity manager class will help you figure out the type of connected network.
boolean isWiFi = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;
Update:
You can use TelephonyManager.getNetworkType() but I am not aware of any broadcast receiver that can be registered to be notified about the change in the network.

Community
- 1
- 1

Illegal Argument
- 10,090
- 2
- 44
- 61
-
it work only when network connectivity switch between mobile network and wifi but it does not work when mobile network change from 2G to 3G and 4G etc. – user3586231 Nov 09 '14 at 10:42