In this example we will see how to check internet connectivity. When we have requirement to call file on server or call webservice then first check internet connctivity. If internet connection is showing connected then we will call file on server or call webservice. Required ACCESS_NETWORK_STATE permission in mainfest.xml file.
In this example scaning for number of available wifi connections , Creating a broadcast receiver which will called when number of wifi connections changed.