Using broadcast receiver, it's easy to find out whether now the phone is plugged in or not. The following StackOverflow question describes this: Detecting the device being plugged in.
I also know how to check whether the current connection is WIFI or mobile using the function getActiveNetworkInfo()
to keep polling the current connection info.
My question is: Is it possible to use the broadcast receiver to detect the switch between WiFi and 3G? It should be more efficient.