Code example for JSONObject

Methods: optInt

0
    return tree;
  } 
 
  @Override 
  public Orientation getDeviceOrientation() { 
    int i = tree.optInt("deviceOrientation");
    return Orientation.fromInterfaceOrientation(i);
  } 
 
  @Override 
  public URL getEndPoint() {
    try { 
      return new URL("http://localhost:4444/wd/hub");
    } catch (MalformedURLException e) {
      throw new RuntimeException("NI");
    } 
  } 
 
  @Override 
  public JSONObject getStatus() {
    return status;