We provide complete mobile and web apps development solutions

Sunday, August 11, 2013

Android Internet Connectivity Check Api

   ConnectivityManager connManager = (ConnectivityManager) contex.getSystemService(Context.CONNECTIVITY_SERVICE);

 android.net.NetworkInfo wifi = connManager
                    .getNetworkInfo(ConnectivityManager.TYPE_WIFI);

 android.net.NetworkInfo mobile = connManager
                    .getNetworkInfo(ConnectivityManager.TYPE_MOBILE);

            if (wifi.isAvailable()) {
                return true;
            } else if (mobile.isAvailable()) {
                return true;
            } else {
                return false;

            }

0 coment�rios:

Post a Comment

Online Training

Your Name :
Your Email: (required)
Your Message: (required)

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts