How to check Network Connectivity Status in Android

In this post, we will see how to check the Network Connectivity Status in Android. Our app may have to behave differently based on the network it is connected i.e wifi,mobile,vpn etc., To check the network connectivity info, we use the ConnectivityManager and NetworkInfo class of android net package.

The below snippet demonstrates how to detect whether the mobile is connected to WIFI or Mobile data.

Code Snippet:


  1. It is really a great work and the way in which u r sharing the knowledge is excellent. As a beginner in Android programming your post help me a lot. Android Training institute in chennai | Android Training in chennai

  2. Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
    Android Training in chennai | Android Training | Best Android Training in chennai