AndroidHttpClient getParams - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:close, execute, getParams
      ByteArrayEntity entity = new ByteArrayEntity(mms);
 
      entity.setContentType("application/vnd.wap.mms-message");
 
      request.setEntity(entity);
      request.setParams(client.getParams());
      request.addHeader("Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic");
//      request.addHeader("x-wap-profile", "http://www.htcmms.com.tw/Android/Common/nexusone/ua-profile.xml"); 
      request.addHeader("x-wap-profile", "http://www.google.com/oha/rdf/ua-profile-kila.xml");
      HttpResponse response = client.execute(target, request);
      StatusLine status     = response.getStatusLine();
 
      if (status.getStatusCode() != 200)
        throw new IOException("Non-successful HTTP response: " + status.getReasonPhrase());
 
      return parseResponse(response.getEntity());
    } catch (URISyntaxException use) {
      Log.w("MmsSendHelper", use);
      throw new IOException("Couldn't parse URI.");
    } finally { 

8
CodeRank
This code example shows how to use the following methods:getParams
    private final AndroidHttpClient mHttpClient;
 
    public OpenSearchSearchEngine(Context context, SearchEngineInfo searchEngineInfo) {
        mSearchEngineInfo = searchEngineInfo;
        mHttpClient = AndroidHttpClient.newInstance(USER_AGENT);
        HttpParams params = mHttpClient.getParams();
        params.setLongParameter(HTTP_TIMEOUT, HTTP_TIMEOUT_MS);
    } 
 
    public String getName() {
        return mSearchEngineInfo.getName();
    } 
 
    public CharSequence getLabel() {
        return mSearchEngineInfo.getLabel();
    } 
 
    public void startSearch(Context context, String query, Bundle appData, String extraData) {
        String uri = mSearchEngineInfo.getSearchUriForQuery(query);
        if (uri == null) {
5
CodeRank
This code example shows how to use the following methods:enableCurlLogging, getParams
		this.httpContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
		this.httpClient = AndroidHttpClient
				.newInstance("Apache-HttpClient/4.1.1 (java 1.5)");
		this.credenziali = credenziali;
		this.isLoggedIn = false;
		this.httpClient.enableCurlLogging(this.getClass().getSimpleName(),
				Log.INFO);
		HttpClientParams.setRedirecting(this.httpClient.getParams(), true);
		this.httpClient.getParams().setBooleanParameter(
				ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
	} 
 
	public PortaleStudentiClient() { 
		this(null); 
	} 
 
	/* 
	 * this method should be private but made package visible to test it within 
	 * a junit test case 
	 */ 
5
CodeRank
This code example shows how to use the following methods:getParams
    private final AndroidHttpClient mHttpClient;
 
    public OpenSearchSearchEngine(Context context, SearchEngineInfo searchEngineInfo) {
        mSearchEngineInfo = searchEngineInfo;
        mHttpClient = AndroidHttpClient.newInstance(USER_AGENT);
        HttpParams params = mHttpClient.getParams();
        params.setLongParameter(HTTP_TIMEOUT, HTTP_TIMEOUT_MS);
    } 
 
    public String getName() {
        return mSearchEngineInfo.getName();
    } 
 
    public CharSequence getLabel() {
        return mSearchEngineInfo.getLabel();
    } 
 
    public void startSearch(Context context, String query, Bundle appData, String extraData) {
        String uri = mSearchEngineInfo.getSearchUriForQuery(query);
        if (uri == null) {
4
CodeRank
This code example shows how to use the following methods:getParams
 
     
    public MyOpenSearchSearchEngine(Context context, MySearchEngineInfo searchEngineInfo) {
        mSearchEngineInfo = searchEngineInfo;
        mHttpClient = AndroidHttpClient.newInstance(USER_AGENT);
        HttpParams params = mHttpClient.getParams();
        params.setLongParameter(HTTP_TIMEOUT, HTTP_TIMEOUT_MS);
    } 
     
    @Override 
    public String getName() {
        return mSearchEngineInfo.getName();
    } 
 
    @Override 
    public CharSequence getLabel() {
        return mSearchEngineInfo.getLabel();
    } 
 
    @Override 
4
CodeRank
This code example shows how to use the following methods:getParams
	private static final String TAG = "SpeechServiceHttpClient";
 
	public SpeechServiceHttpClient() { 
		mHttpClient = AndroidHttpClient.newInstance("xiaomi");
		HttpConnectionParams 
				.setSoTimeout(this.mHttpClient.getParams(), TIMEOUT);
		this.mExtensionRegistry = ExtensionRegistryLite.newInstance();
		SpeechService.registerAllExtensions(this.mExtensionRegistry);
		VoiceSearch.registerAllExtensions(this.mExtensionRegistry);
	} 
 
	public ResponseMessage post(RecognitionParameters mParams,
			RequestMessage requestMessage) throws ConnectionException {
		ResponseMessage responseMessage = null;
		InputStream inputStream = null;
		try { 
			inputStream = post(mParams.getSpeechServerUrl(),
					requestMessage.toByteArray());
			responseMessage = SpeechService.ResponseMessage.parseFrom(
					inputStream, this.mExtensionRegistry);
4
CodeRank
This code example shows how to use the following methods:getParams
	 
	public MobiAdsBatch (String userAgent, String encoded, Context context, String cookie) {
		this.context = context;
		this.httpClient = AndroidHttpClient.newInstance(userAgent);
		this.mobiAdsCookie = cookie;
		this.httpClient.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, encoded);
		this.httpClient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
		 
	} 
	 
	 
	public void makeUseOfNewLocation(Location location) {
    	 
    	final String latitude = Double.toString(location.getLatitude());
    	final String longitude = Double.toString(location.getLongitude());
        final String latitudeReplace = latitude.replace(".", ",");
        final String longitudeReplace = longitude.replace(".", ",");
    	final String URLAuth = "http://users.mobiads.gumartinm.name/userfront.php/api/" + latitudeReplace + "/" + longitudeReplace + "/gpsads.json";
    	URL url = null;
    	 
4
CodeRank
This code example shows how to use the following methods:getParams
 
	private HttpRequestHandler() { 
		if (client == null) {
			client = AndroidHttpClient.newInstance("Android");
			mLocalContext.setAttribute(ClientContext.COOKIE_STORE, mCookieStore);
			client.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
		} 
	} 
	 
	public static HttpRequestHandler getInstance() { 
		if (_hrh == null) {
			_hrh = new HttpRequestHandler();
		}  
		return _hrh;
	} 
	 
	public void finalize() { 
		// don't leak; 
		client.close();
	} 
4
CodeRank

Related AndroidHttpClient getParams Questions & Answers:

getParams Method Overview
Obtains the parameters for this client.
See Code Examples for other Android AndroidHttpClient Methods: