Checks if the device is a tablet or a phone

@param activityContext The Activity Context.
@return Returns true if the device is a Tablet
331460
public DeviceType getDeviceType(Context activityContext) {
		// Verifies if the Generalized Size of the device is XLARGE to be
		// considered a Tablet
		boolean xlarge = ((activityContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == SCREENLAYOUT_SIZE_XLARGE);

		// If XLarge, checks if the Generalized Density is at least MDPI
		// (160dpi)
		if (xlarge) {
			DisplayMetrics metrics = new DisplayMetrics();
			Activity activity = (Activity)activityContext;
			activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
			
			// MDPI=160, DEFAULT=160, DENSITY_HIGH=240, DENSITY_MEDIUM=160,
			// DENSITY_TV=213, DENSITY_XHIGH=320
			if (metrics.densityDpi == DisplayMetrics.DENSITY_DEFAULT
				|| metrics.densityDpi == DisplayMetrics.DENSITY_HIGH
				|| metrics.densityDpi == DisplayMetrics.DENSITY_MEDIUM
				|| metrics.densityDpi == DENSITY_TV
				|| metrics.densityDpi == DENSITY_XHIGH) {

				// this is a tablet!
				return DeviceType.Tablet;
			}
		}

		// this is not a tablet!
		return DeviceType.Handset;
	}
178521
public static boolean isConnected(Context context) {
        if (context == null) {
            return true;
        }
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = cm.getActiveNetworkInfo();
        return info != null && info.isConnectedOrConnecting();
    }
1150886
public static boolean checkForRunningService(Context ctx, String serviceClassName) {
        ActivityManager manager = (ActivityManager) ctx.getSystemService(Context.ACTIVITY_SERVICE);
        for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
            if (serviceClassName.equals(service.service.getClassName())) {
                return true;
            }
        }
        return false;
    }
1369362
def is_device(self):
		

		if self in {type(self).DEVICE_ADDED, type(self).DEVICE_REMOVED}:
			return True
		else:
			return False
625079
public static boolean isTopApplication(Context context) {
		ComponentName activity = getTopActivity(context);
		if (activity == null) {
			return false;
		}
		return activity.getPackageName().equals(context.getApplicationInfo().packageName);
	}
967276
private static boolean isNookDevice() {
        String brand = Build.BRAND;
        String manufacturer = System.getProperty("ro.nook.manufacturer");
        return ((brand != null && brand.equalsIgnoreCase("nook")) ||
                manufacturer != null && manufacturer.equalsIgnoreCase("nook"));
    }
1057016
public boolean isWorkActivity(Long pWorkId) {

        if(this.activities == null){
            return false;
        }
        for(int i=0; i<activities.size(); i++){
            if(pWorkId.longValue() == activities.get(i).getId().longValue()){
                return true;
            }
        }
        return false;
    }
1188367
public static boolean isTablet(Device device, SitePreference sitePreference) {
		return sitePreference == SitePreference.TABLET || device != null && device.isTablet() && sitePreference == null;
	}
217049
private boolean getActivityImplicity(final ACTIVITY activity) {
        if (this.activity == ACTIVITY.ALL) {
            return true;
        }

        if ((activity == ACTIVITY.SUBSCRIBE) && (this.activity == ACTIVITY.PUBLISH)) {
            return false;
        } else if ((activity == ACTIVITY.PUBLISH) && (this.activity == ACTIVITY.SUBSCRIBE)) {
            return false;
        } else if (activity == ACTIVITY.ALL && this.getActivity() != ACTIVITY.ALL) {
            return false;
        }
        return true;
    }
242742
public static boolean isNormal(Device device, SitePreference sitePreference) {
		return sitePreference == SitePreference.NORMAL ||
				(device == null || device.isNormal() && sitePreference == null);
	}
252258
public static boolean isOnline(Context context) {
        int res = context.checkCallingOrSelfPermission(Manifest.permission.ACCESS_NETWORK_STATE);
        if (res == PackageManager.PERMISSION_GRANTED) {
            ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo netInfo = cm.getActiveNetworkInfo();
            if (netInfo != null && netInfo.isConnectedOrConnecting()) {
                return true;
            }
            return false;
        }

        return true;
    }
462861
private function currentMobile()
    {
        if (!$this->MobileDetect || !($this->MobileDetect instanceof \Mobile_Detect)) {
            return false;
        }

        //for phones only, not tablets
        //create your own Strategy if needed, and change this functionality
        return $this->MobileDetect->isMobile() && !$this->MobileDetect->isTablet();
    }
198894
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
    public static boolean hasUsbHostFeature(Context context) {
        return hasUsbHostFeature(context.getPackageManager());
    }
1183335
def detect_maemo_tablet()
      if (user_agent.include?(MAEMO))
        return true
      elsif (user_agent.include?(LINUX) && user_agent.include?(DEVICE_TABLET) && !detect_web_o_s_tablet() && !detect_android())
        return true
      end
      return false
    end
1020496
@TargetApi(Build.VERSION_CODES.KITKAT)
    public static boolean hasStepCounterSensorFeature(Context context) {
        return hasStepCounterSensorFeature(context.getPackageManager());
    }
408598
private boolean isActivityMatching(Activity currentActivity, String name){
		if(currentActivity != null && currentActivity.getClass().getSimpleName().equals(name)) {
			return true;
		}
		return false;
	}
451164
public boolean detectFirefoxOSPhone() {

        //First, let's make sure we're NOT on another major mobile OS.
        if (detectIos() || detectAndroid() || detectSailfish()) {
            return false;
        }

        if ((userAgent.indexOf(engineFirefox) != -1) && (userAgent.indexOf(mobile) != -1)) {
            return true;
        }

        return false;
    }