@Override
  public boolean isSelendroidRunning() {
    HttpClient httpClient = HttpClientBuilder.create().build();
    String url = WD_STATUS_ENDPOINT.replace("8080", String.valueOf(localPort));
    log.info("Checking if the Selendroid server is running: " + url);
    HttpRequestBase request = new HttpGet(url);
    HttpResponse response;
    try {
      response = httpClient.execute(request);
    } catch (Exception e) {
      log.log(
        Level.INFO,
        "Can't connect to Selendroid server, assuming it is not running.",
        e);
      return false;
    }

    int statusCode = response.getStatusLine().getStatusCode();
    log.info("Got response status code: " + statusCode);
    String responseValue;
    try {
      responseValue = IOUtils.toString(response.getEntity().getContent());
      log.info("Got response value: " + responseValue);
    } catch (Exception e) {
      log.log(Level.INFO, "Error reading response from selendroid-server", e);
      log.info("Assuming server has not started");
      return false;
    }

    return statusCode == 200 && responseValue.contains("selendroid");
  }
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