Learn Android for Free,issues for developers, mobengineers website provide complete solutions for developers issues posts.It also provides online training for android development

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

20% off

Online Training

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

NDTV Gadgets360

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts