public boolean screenSizeMatches(String requestedScreenSize) {
    // if screen size is not requested, just ignore it
    if (requestedScreenSize == null || requestedScreenSize.isEmpty()) {
      return true;
    }

    Pattern dimensionPattern = Pattern.compile("([0-9]+)x([0-9]+)");
    Matcher dimensionMatcher = dimensionPattern.matcher(requestedScreenSize);
    if (dimensionMatcher.matches()) {
      int width = Integer.parseInt(dimensionMatcher.group(1));
      int height = Integer.parseInt(dimensionMatcher.group(2));
      return getScreenSize().equals(new Dimension(width, height));
    } else {
      return false;
    }
  }
Constructor mean to be used with Android Hardware devices because a reference to the
{@link IDevice} will be available immediately after they are connected.

@param device
selendroid-standalone/src/main/java/io/selendroid/standalone/android/impl/AbstractDevice.java