Home > Android > Android: Check network connection

Android: Check network connection

This will help to to detect if your android has any internet connection

This will return true i.e your application has internet connection.


 private boolean isNetworkAvailable() {
        ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
        return activeNetworkInfo != null;
    }

Enjoy.. 😉 !!!!!!!

Advertisements
Categories: Android Tags:
  1. nadenla narendra
    May 16, 2012 at 7:33 am

    its really working good ……………………….

  2. April 6, 2014 at 5:08 pm

    Simply wish to say your article is as astounding.

    The clearness in your post is simply cool and i could assume you’re an
    expert on this subject. Well with your permission allow me to grab your feed to keep up to date with forthcoming
    post. Thanks a million and please continue the gratifying work.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: