Code example for AndroidHttpClient

Methods: getParams

0
	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);