Back to project page app_starter.
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.
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; } }