https://kotlinlang.org logo
#ktor
Title
# ktor
d

Dean Djermanović

07/19/2022, 10:28 AM
What are the differences between
HttpClient(Android)
and
HttpClient(OkHttp)
with regards to
ktor-client
?
b

Big Chungus

07/19/2022, 11:09 AM
Mainly minimal supported android version
d

Dean Djermanović

07/19/2022, 12:45 PM
There’s no difference in the underlying implementation? Why wouldn’t we then always use the one that supports lower version?
b

Big Chungus

07/19/2022, 12:47 PM
d

Dean Djermanović

07/19/2022, 12:57 PM
Yes, I went through that. That doesn’t really answer my question. They only say there’s
CIO
,
Android
and
OkHttp
engines that can be used on Android platform. I’m currently using
Android
engine and I want to switch to
OkHttp
for specific reasons. Are there some downsides of doing that? Performance impact, behaviour changes, etc.?
b

Big Chungus

07/19/2022, 12:58 PM
Behaviour should not change apart from bumping into unsupported android/jvm versions or http features (as listed in the linked tables)
I don't think there are any performance comparisons between the engines
CIO is the only http engine implemented from scratch. The other two just wrap existing industry standard http libraries
d

Dean Djermanović

07/19/2022, 1:02 PM
Thanks for the information. OkHttp engine wraps OkHttp, do you maybe know which library Android engine wraps?
b

Big Chungus

07/19/2022, 1:02 PM
Native android http client from sdk
d

Dean Djermanović

07/19/2022, 1:03 PM
Thank you
b

Big Chungus

07/19/2022, 1:03 PM
You're welcome
a

Aleksei Tirman [JB]

07/19/2022, 2:03 PM
Also, you can find the discussion about difference between those two engines here.
👍 1
3 Views