Android Open Source - NoteZap Network Checker






From Project

Back to project page NoteZap.

License

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.

Java Source Code

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;
  } 

}




Java Source Code List

com.outerthoughts.notezap.BatchedSendService.java
com.outerthoughts.notezap.EnterZapActivity.java
com.outerthoughts.notezap.NetworkChecker.java
com.outerthoughts.notezap.NetworkStateChangeReceiver.java
com.outerthoughts.notezap.PreferencesMainActivity.java
com.outerthoughts.notezap.SendIntentService.java
com.outerthoughts.notezap.WidgetProvider.java