Skip to content

[REQ] [kotlin-client] Add support for OkHttp3 to support Android API 4.X #4007

@4brunu

Description

@4brunu

Is your feature request related to a problem? Please describe.

In #3504 the version of OkHttp version was bumped from 3.14.2 to 4.0.1.

This has a side effect that the Kotlin-client no longer supports Android 4.X version, it only supports Android 5.0 and upwards, because OkHttp 4.X only supports Android 5.0 and upwards.
https://github.com/square/okhttp/blob/master/README.md#requirements

But the Android 4.X version still represents 10% of all Android devices, and some companies still need to support those devices.
https://developer.android.com/about/dashboards/

I'm not sure if this change was an accident, but it would be great if Kotlin-client supports Android 4.X.

Describe the solution you'd like

The solution that I propose Is to support both OkHttp 3 and 4 and give the flexibility to the user to choose which one is best for them.

Describe alternatives you've considered

There are two other alternatives:

  • Support only OkHttp3 and drop OkHttp4 and this would allow to support Android 2.3.X +.
  • Continue to support only OkHttp4 and support only Android 5.X +, and drop support for 10% of all Android. Not ideal to a lot of companies.

I think that support both OkHttp3 and OkHttp4 is the preferable approach because of the flexibility it gives and it shouldn't create a lot complexity.

Additional context

Check the Android versions market share for more context.
https://developer.android.com/about/dashboards/

And also the OkHttp readme.
https://github.com/square/okhttp/blob/master/README.md#requirements

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions