Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android use OkHttp internally?

This is a stack trace I get when running an Android app I recently inherited. We're not using OkHttp as an explicitly dependency, and the com.android.okhttp in the trace makes me think the AOSP is using OkHttp now internally?

java.lang.Throwable: Explicit termination method 'close' not called E      at dalvik.system.CloseGuard.open(CloseGuard.java:184) E      at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:278) E      at com.android.okhttp.Connection.upgradeToTls(Connection.java:146) E      at com.android.okhttp.Connection.connect(Connection.java:107) E      at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294) E      at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255) E      at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206) E      at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345) E      at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296) E      at com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:143) E      at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:544) E      at java.net.URLConnection.getContentLength(URLConnection.java:316) E      at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:182) 
like image 896
user3837683 Avatar asked Sep 23 '14 16:09

user3837683


People also ask

Does Android use OkHttp?

squareup. okhttp , artifactId, okhttp and the version 2.5. 0 (current as of this writing). As of Android 5.0, OkHttp is part of the Android platform and is used for all HTTP calls.

What is OkHttp client in Android?

OkHttp android provides an implementation of HttpURLConnection and Apache Client interfaces by working directly on a top of java Socket without using any extra dependencies.

Does retrofit uses OkHttp?

Retrofit is basically architecture above the OKHTTP, it internally uses OkHttp to make any request , earlier in jave if we want to make any request we have HTTPUrl connection or HTTPS Url connect know retrofit okHttp handles everything ( it divides into packages it marks headers )for us if we need to send some ...

What is the underlying library of OkHttp?

Beginning with Mobile SDK 4.2, the Android REST request system uses OkHttp (v3. 2.0), an open-source external library from Square Open Source, as its underlying architecture. This library replaces the Google Volley library from past releases.


1 Answers

Yes, Android as of Android 4.4 is using OkHttp for its internal HttpUrlConnection implementation.

like image 107
CommonsWare Avatar answered Sep 19 '22 15:09

CommonsWare