Code example for JSONObject

Methods: optInt

0
    return elementTree;
  } 
 
  @Override 
  public Orientation getDeviceOrientation() { 
    int i = elementTree.optInt("deviceOrientation");
    return Orientation.fromInterfaceOrientation(i);
  } 
 
  @Override 
  public URL getEndPoint() {
    return remoteEndPoint;
  } 
 
  @Override 
  public JSONObject getStatus() {
 
    try { 
      HttpClient client = HttpClientFactory.getClient();
      String url = getEndPoint() + "/status";
      URL u = new URL(url);