Back to project page unicef_gis_mobile.
The source code is released under:
MIT License
If you think the Android project unicef_gis_mobile 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 org.unicef.gis.infrastructure; // ww w . j ava 2s.c o m import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Network { private Context context; public Network(Context context){ this.context = context; } public boolean connected() { ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); return (networkInfo != null && networkInfo.isConnected()); } }