Android Question Two versions of OkHttpUtils in the same application?

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I am finding that some clients can't run my application that uses OkHttpUtils2 if it has old android.
The tests I have done show me that android v5 onwards is required.
Is there any way to be able to use older OkHttpUtils for clients that have android lower than v5?
I mean that the same application works on android v4 onwards, and that I can indicate which version of OkHttpUtils to use depending on their version of android.
Will I have to create a specific version for android lower than v5?
Thanks.
 

vecino

Well-Known Member
Licensed User
Longtime User
Yes, I know, the solution is for customers to buy newer devices, but I can't tell them that.

:rolleyes:
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
it's not 2 different versions of okhttputils2; it's okhttputils2 and httputils.
as i recall, you can have both versions in the same app. have you tried?
just wear safety goggles.

you need 2 download routines, 1 for devices < android 5 and 1 for > 5.
the library names/classes/services are distinct, and if you're careful about variable
names and code separation, it should work.
i'm pretty sure i answered similarly a while back after having tested it...
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hi, is the current version "okhttputils2", and is the old version "okhttp", or is there an "okhttputils" version?
Thank you.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The actual Version is okhttputils2 and okhttp. Both belong together.
 
Upvote 0
Top