class HttpStackFactory {

	public static HttpStack createDefaultHttpStack() {
		HttpStack httpStack = null;
		HttpClient httpClient = null;

		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
			httpStack = createHurlStack();
        } else {
			// Prior to Gingerbread, HttpUrlConnection was unreliable.
			// See: http://android-developers.blogspot.com/2011/09/androids-http-clients.html
			httpClient = createAndroidHttpClient(DEFAULT_USER_AGENT);
			httpStack = createHttpClientStack(httpClient);
        }

		MultipartHttpStack multipartStack = new DefaultMultipartHttpStack(httpClient);
		HttpStack completedStack = new MultipartHttpStackWrapper(httpStack, multipartStack);

		return completedStack;
	}

}