Back to project page NoteToGDocs_Drive-Java-API.
The source code is released under:
GNU General Public License
If you think the Android project NoteToGDocs_Drive-Java-API 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.smokybob.NoteToGDocs; //from w ww .j a va 2 s . com import android.app.Activity; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Util { //MSO - 20130411 - Check the network State public static boolean CheckNetwork(Activity activity){ boolean toRet=false; //Get the Connectivity Manager from the calling Activiy ConnectivityManager connMgr = (ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE); //Get The network Infos NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); //Check if Connected if (networkInfo != null && networkInfo.isConnected()){ toRet= true; } else { toRet=false; } return toRet; } }