Android Open Source - app_starter Connection Detector






From Project

Back to project page app_starter.

License

The source code is released under:

GNU General Public License

If you think the Android project app_starter 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 appname.companyname.com.appname;
/*  w  w w . j  a v  a 2s  .  c  o m*/
import android.content.Context;
import android.net.ConnectivityManager;
 
public class ConnectionDetector {

  private Boolean offline_app = AppContent.offline_app; 
    private Context mContext;
     
    public ConnectionDetector(Context context){
        this.mContext = context;
    }
 
    public boolean isConnectingToInternet(){
      
      ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
    if((cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected() == true) || offline_app == true)
    {
      return true; 
    }
    
    return false;

    }
}




Java Source Code List

appname.companyname.com.appname.AppContent.java
appname.companyname.com.appname.ConnectionDetector.java
appname.companyname.com.appname.Error.java
appname.companyname.com.appname.Functions.java
appname.companyname.com.appname.MyActivity.java
appname.companyname.com.appname.Rateme.java
appname.companyname.com.appname.SplashScreen.java