Back to project page tdpforce.
The source code is released under:
Apache License
If you think the Android project tdpforce 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.telugudesam.cadre.util; //w ww . j a v a 2 s . c o m import java.util.Set; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import com.parse.ParseObject; public class Utils { public static boolean isNetworkAvailable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo wifiNetwork = connectivityManager .getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (wifiNetwork != null && wifiNetwork.isConnected()) { return true; } NetworkInfo mobileNetwork = connectivityManager .getNetworkInfo(ConnectivityManager.TYPE_MOBILE); if (mobileNetwork != null && mobileNetwork.isConnected()) { return true; } NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo(); if (activeNetwork != null && activeNetwork.isConnected()) { return true; } return false; } public static void printParseObject(ParseObject object) { Set<String> keys = object.keySet(); L.d("parse object start"); for (String key : keys) { L.d(key + " = " + object.get(key)); } L.d("parse object end"); } }