Back to project page NoteZap.
The source code is released under:
MIT License
If you think the Android project NoteZap 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.outerthoughts.notezap; /* w w w. j av a 2 s. c om*/ import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class NetworkChecker { public static boolean isNetworkAvailable(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = cm.getActiveNetworkInfo(); // if no network is available networkInfo will be null // otherwise check if we are connected if (networkInfo != null && networkInfo.isConnected()) { return true; } return false; } }