Ari H
Ari H

Reputation: 75

Is okHttp part of Android or not?

According to some references, e.g. Does Android use OkHttp internally? Android is using (or at least was using) okHttp internally under HttpUrlConnection. Still in some recent discussions (e.g. Why HTTP/2 is not supported by Android's HttpUrlConnection?) it is recommended to use okHttp from GitHub rather than Android http APIs. So I am confused. Does anyone have a definitive answer?

Upvotes: 3

Views: 985

Answers (1)

Basi
Basi

Reputation: 3158

From Android 4.4 onwards using OkHttp for its internal HttpUrlConnection implementation

Source: https://twitter.com/JakeWharton/status/482563299511250944

Versions of OkHttp used in Android:

  • Android 4.4: OkHttp 1.1.2
  • Android 5.x: OkHttp 2.0.0
  • Android 6.0: OkHttp 2.4.0
  • Android 7.x: OkHttp 2.6.0
  • Android 8.0+: OkHttp 2.7.5

You can check what version of OkHttp Kitkat uses here: https://android.googlesource.com/platform/external/okhttp/+/refs/heads/kitkat-release/pom.xml

For other Android releases replace kitkat-release in the URL with <your-dessert>-release.

Upvotes: 8

Related Questions