NetHttpTransport
directly or switch to Cronet which is better supported.@Beta @Deprecated public class AndroidHttp extends Object
Beta
Modifier and Type | Method and Description |
---|---|
static HttpTransport |
newCompatibleTransport()
Deprecated.
Returns a new thread-safe HTTP transport instance that is compatible with Android SDKs prior to
Gingerbread.
|
public static HttpTransport newCompatibleTransport()
Don't use this for Android applications that anyway require Gingerbread. Instead just call
new NetHttpTransport()
.
Prior to Gingerbread, the HttpURLConnection
implementation was buggy, and the Apache
HTTP Client was preferred. However, starting with Gingerbread, the HttpURLConnection
implementation bugs were fixed, and is now better supported than the Apache HTTP Client. There
is no guarantee that Apache HTTP transport will continue to work in future SDKs. Therefore,
this method uses NetHttpTransport
for Gingerbread or higher, and otherwise ApacheHttpTransport
.
Copyright © 2011–2023 Google. All rights reserved.