+ private boolean isConnectedViaWiFi(Context context) {
+ ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ return cm != null && cm.getActiveNetworkInfo() != null &&
+ cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI &&
+ cm.getActiveNetworkInfo().getState() == State.CONNECTED;
+ }
+
+ private boolean instantUploadEnabled(Context context) {
+ return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("instant_uploading", false);
+ }
+
+ private boolean instantUploadViaWiFiOnly(Context context) {
+ return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("instant_upload_on_wifi", false);
+ }