Back to project page kluster-android.
The source code is released under:
Apache License
If you think the Android project kluster-android 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 com.cs446.kluster.net; /*from ww w . ja v a2 s . com*/ import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.widget.Toast; public class NetworkUtils { public NetworkUtils() { // TODO Auto-generated constructor stub } public static Boolean CheckConnection(Context context) { ConnectivityManager connMgr = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { return true; } else { Toast.makeText(context, "No Connection", Toast.LENGTH_SHORT).show(); return false; } } }