We provide complete mobile and web apps development solutions

Showing posts with label android internet. Show all posts
Showing posts with label android internet. Show all posts

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;

            }

Online Training

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

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts