Code example for HttpHost

0
      if (Build.VERSION.SDK_INT < 14) {
 
        Object requestQueueObject = getRequestQueue(ctx);
        if (requestQueueObject != null) {
          // Create Proxy config object and set it into request Q 
          HttpHost httpHost = new HttpHost(host, port, "http");
 
          setDeclaredField(requestQueueObject, "mProxyHost", httpHost);
          ret = true;
        } 
      } else { 
        ret = setICSProxy(host, port);
      } 
    } catch (Exception e) {
      Log.e(TAG, "error setting up webkit proxying", e);
    } 
    return ret;
  } 
 
  private static boolean setICSProxy(String host, int port)
      throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException,