Checks if the device has a GPS location feature.
@param context the context.
@return {@code true} if the device has a GPS location feature.
165187
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasGpsLocationFeature(Context context) {
        return hasGpsLocationFeature(context.getPackageManager());
    }
312831
boolean checkAvailablePush(Context context) {

        int connectionStatus = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
        if (connectionStatus == ConnectionResult.SUCCESS) {
            log.i("Google Play Services are available on this device.");
            return true;
        } else {
            if (GoogleApiAvailability.getInstance().isUserResolvableError(connectionStatus)) {
                log.e("Google Play Services is probably not up to date. User recoverable Error Code is " + connectionStatus);
            } else {
                log.e("This device is not supported by Google Play Services.");
            }
            return false;
        }
    }
188246
public static boolean isCurrentConnectionWifi(Context context) {
    ConnectivityManager cm =
        (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    if (cm == null) {
      return false;
    }
    NetworkInfo info = cm.getActiveNetworkInfo();
    return info != null && info.getType() == ConnectivityManager.TYPE_WIFI;
  }
1127374
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasTouchScreenFeature(Context context) {
        return hasTouchScreenFeature(context.getPackageManager());
    }
812024
public static boolean detectCicular(List<Location> subLocations) {
		boolean isCircular = false;
		if(! consistentAccessions(subLocations))
			return isCircular;

		int lastMax = 0;
		for (Location sub : subLocations) {
			if (sub.getEnd().getPosition() > lastMax) {
				lastMax = sub.getEnd().getPosition();
			}
			else {
				isCircular = true;
				break;
			}
		}
		return isCircular;
	}
261951
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasBluetoothFeature(Context context) {
        return hasBluetoothFeature(context.getPackageManager());
    }
1347349
public static boolean isConnectedToWiFiOrMobileNetwork(Context context) {
    final String service = Context.CONNECTIVITY_SERVICE;
    final ConnectivityManager manager = (ConnectivityManager) context.getSystemService(service);
    final NetworkInfo networkInfo = manager.getActiveNetworkInfo();

    if (networkInfo == null) {
      return false;
    }

    final boolean isWifiNetwork = networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
    final boolean isMobileNetwork = networkInfo.getType() == ConnectivityManager.TYPE_MOBILE;

    if (isWifiNetwork || isMobileNetwork) {
      return true;
    }

    return false;
  }
1137778
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasDistinctMultiTouchScreenFeature(Context context) {
        return hasDistinctMultiTouchScreenFeature(context.getPackageManager());
    }
387907
private boolean isProfile(OperationContext context) {
        PathAddress pa = context.getCurrentAddress();
        return pa.size() > 1 && PROFILE.equals(pa.getElement(0).getKey());
    }
1108031
public boolean isNearTo(Location location, double distance) {
        if (this.is2DLocation() && location.is2DLocation()) {
            return this.isNearTo(location.getLocation2D(), distance);
        } else if (this.is3DLocation() && location.is3DLocation()) {
            return this.isNearTo(location.getLocation3D(), distance);
        } else {
            return false;
        }
    }
1039930
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static boolean hasNfcFeature(Context context) {
        return hasNfcFeature(context.getPackageManager());
    }
491019
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasAccelerometerSensorFeature(Context context) {
        return hasAccelerometerSensorFeature(context.getPackageManager());
    }
777046
@TargetApi(Build.VERSION_CODES.KITKAT)
    public static boolean hasStepDetectorSensorFeature(Context context) {
        return hasStepDetectorSensorFeature(context.getPackageManager());
    }
1225372
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public static boolean hasLandscapeScreenFeature(Context context) {
        return hasLandscapeScreenFeature(context.getPackageManager());
    }
773080
public static boolean isPost(final WebContext context) {
        return HttpConstants.HTTP_METHOD.POST.name().equalsIgnoreCase(context.getRequestMethod());
    }
1214824
public static boolean isCircularBoundary(
			CompoundLocation<Location> location, long sequenceLength) {
		if (location.getLocations().size() == 1) {
			return false;// cant be if there is only 1 location element
		}

		boolean lastLocation = false;
		List<Location> locationList = location.getLocations();
		for (int i = 0; i < locationList.size(); i++) {
			if (i == locationList.size() - 1) {
				lastLocation = true;
			}

			Long position = location.getLocations().get(i).getEndPosition();
			if (position == sequenceLength && !lastLocation) {
				return true;
			}
		}
		return false;
	}
717053
public static void getLastKnownLocation(Context context, boolean waitForGpsFix, final LocationResult cb) {
        DeviceLocation deviceLocation = new DeviceLocation();

        LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        Location last_loc;
        last_loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
        if (last_loc == null)
            last_loc = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

        if (last_loc != null && cb != null) {
            cb.gotLocation(last_loc);
        } else {
            deviceLocation.getLocation(context, cb, waitForGpsFix);
        }
    }