HttpParams setBooleanParameter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for HttpParams setBooleanParameter method.

This code example shows how to use the following methods:setBooleanParameter, setIntParameter, setParameter
    private final ConnectionReuseStrategy connStrategy;
 
    public TestHttpCore() { 
        super(); 
        this.params = new SyncBasicHttpParams();
        this.params.setParameter(HttpProtocolParams.PROTOCOL_VERSION,
                HttpVersion.HTTP_1_1);
        this.params.setBooleanParameter(HttpProtocolParams.USE_EXPECT_CONTINUE,
                false); 
        this.params.setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK,
                false); 
        this.params.setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE,
                8 * 1024); 
        this.params.setIntParameter(HttpConnectionParams.SO_TIMEOUT,
                15000); 
 
        this.httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
                new RequestContent(),
                new RequestTargetHost(),
                new RequestConnControl(),
6
CodeRank
This code example shows how to use the following methods:setBooleanParameter
This code example shows how to use the following methods:setBooleanParameter
 */ 
public class HttpProvider { 
	private DefaultHttpClient client;
 
	private HttpProvider(int conTimeout, int soTimeout) {
		HttpParams httpParams = new BasicHttpParams();
 
		HttpConnectionParams.setConnectionTimeout(httpParams, conTimeout);
		HttpConnectionParams.setSoTimeout(httpParams, soTimeout);
		httpParams.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false);
 
		client = new DefaultHttpClient(httpParams);
 
	} 
 
	/** 
	 * 创建建使用默认超时时间的实例  
	 * @return 
	 */ 
	public static HttpProvider newInstance() { 
4
CodeRank
This code example shows how to use the following methods:setBooleanParameter
 
    public static void setRedirecting(final HttpParams params, boolean value) {
        if (params == null) {
            throw new IllegalArgumentException("HTTP parameters may not be null");
        } 
        params.setBooleanParameter
            (ClientPNames.HANDLE_REDIRECTS, value); 
    } 
     
    public static boolean isAuthenticating(final HttpParams params) {
        if (params == null) {
            throw new IllegalArgumentException("HTTP parameters may not be null");
        } 
        return params.getBooleanParameter
            (ClientPNames.HANDLE_AUTHENTICATION, true); 
    } 
 
    public static void setAuthenticating(final HttpParams params, boolean value) {
        if (params == null) {
            throw new IllegalArgumentException("HTTP parameters may not be null");
5
CodeRank
This code example shows how to use the following methods:setBooleanParameter
 
	private Context context;
	private HttpClient client;
 
	private HttpClient setupClient() {
		HttpParams params = new BasicHttpParams();
		HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
		HttpProtocolParams.setContentCharset(params, "UTF-8");
		params.setBooleanParameter("http.protocol.expect-continue", false);
		client = new DefaultHttpClient(params);
		return client;
	} 
	 
	private JSONObject createJSONObject(HttpResponse result)
			throws IOException, JSONException { 
		InputStream content = result.getEntity().getContent();
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				content));
		try { 
			StringBuffer buf = new StringBuffer();
4
CodeRank
This code example shows how to use the following methods:setBooleanParameter, setLongParameter
    public static final String SYNC_INJURYUPDATES_URI = BASE_URL + "/injuryupdates/";
    public static final String SYNC_SCREENINGUPDATES_URI = BASE_URL + "/screeningupdates/";
    public static final int HTTP_REQUEST_TIMEOUT_MS = 70 * 1000;
     
    private static final String SYNC_MARKER_KEY = "com.sportsfire.sync.marker";
    private static final String SYNC_SCREEN_MARKER_KEY = "com.sportsfire.sync.screen marker";
 
 
 
	public SyncAdapter(Context context, boolean autoInitialize) {
		super(context, autoInitialize);
		mAccountManager = AccountManager.get(context);
		mContentResolver = context.getContentResolver();
		this.context = context;
	} 
	 
	 /** 
     * Configures the httpClient to connect to the URL provided. 
     */ 
    public static HttpClient getHttpClient() {

4
CodeRank
This code example shows how to use the following methods:setBooleanParameter, setLongParameter
        HttpClient httpClient = new DefaultHttpClient();
        final HttpParams params = httpClient.getParams();
        HttpConnectionParams.setConnectionTimeout(params, HTTP_REQUEST_TIMEOUT_MS);
        HttpConnectionParams.setSoTimeout(params, HTTP_REQUEST_TIMEOUT_MS);
        ConnManagerParams.setTimeout(params, HTTP_REQUEST_TIMEOUT_MS);
        params.setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
        return httpClient;
    } 
 
	@Override 
	public void onPerformSync(Account account, Bundle extras, String authority,
			ContentProviderClient provider, SyncResult syncResult) {
		String authtoken = null;
 
		loadSquadsAndPlayers(); 
		updateInjuries(account);
		 
		 
	} 
 
4
CodeRank
This code example shows how to use the following methods:setBooleanParameter

Related HttpParams setBooleanParameter Questions & Answers:

setBooleanParameter Method Overview
Assigns a Boolean to the parameter with the given name
See Code Examples for other Android HttpParams Methods: