コード例 #1
0
  public void doRequest(
      HttpMethod method,
      __HttpConnectionResponseHandler responseHandler,
      String url,
      HashMap<String, String> params) {
    /*
     * [ Check network connection state ]
     */
    if (!DeviceUtil.isNetworkAvailable(AppGlobalApplication.getAppGlobalApplicationContext())) {
      return;
    }

    if (method.equals(HttpMethod.GET)) {

      GetMethodRequestObject requestObject =
          new GetMethodRequestObject(responseHandler, url, params);
      requestObject.start();

    } else if (method.equals(HttpMethod.POST)) {

      PostMethodRequestObject requestObject =
          new PostMethodRequestObject(responseHandler, url, params);
      requestObject.start();
    }
  }
コード例 #2
0
 public static __HttpConnectionManager getInstance() {
   if (instance == null) {
     synchronized (__HttpConnectionManager.class) {
       instance = new __HttpConnectionManager();
       AppGlobalApplication.getAppGlobalApplicationContext().addDisposableResource(instance);
     }
   }
   return instance;
 }