OkHttp support for SDK versions less than 21

泄露秘密 提交于 2019-12-10 04:04:39

问题


OkHttp has recently dropped support for Android 4, except via a separate 3.12.x branch that will be supported until end of Dec 2020 (and probably receive no more than critical updates or bugfixes).

On the assumption that you wish to continue to support Android 4, like I do, since 10% of the Android user base is still a significant proportion, and don't want to be stuck in a dead-end branch...

Rather than being stuck on the 3.12.x branch for all sdk versions, is there any way of using the 3.12 branch for sdk < 21 and the 3.13 branch for sdk >= 21, a bit like it would of course be possible to use HttpUrlConnection for sdk < 21 and OkHttp 3.13 for sdk >= 21?

来源:https://stackoverflow.com/questions/54652219/okhttp-support-for-sdk-versions-less-than-21

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!