Back to project page ContactsManager.
The source code is released under:
Apache License
If you think the Android project ContactsManager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package silverhillapps.com.contactsmanager.utils; /*from w w w .j av a2s. c om*/ import android.net.ConnectivityManager; import android.net.NetworkInfo; import silverhillapps.com.contactsmanager.CMApplication; /** * Class with some util methods for evaluating the connectivity of the device */ public class ConnectionUtils { /** * This static method checks if the device has a valid internet connection. * @return */ public static boolean isNetworkAvailable(){ ConnectivityManager connectivityManager = (ConnectivityManager) CMApplication.getAppContext().getSystemService(CMApplication.getAppContext().CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } }