Android Question Needing okHTTP support for Android 4.x

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Hi all.

Working on an app that will NEVER see the play store and will be open source, GITHUB style. Anyway i want it to run on Android 4.x and above.
Point being to re claim all those old Android devices every one just tosses in a drawer or the garbage dump and never use again.

Am using the latest B4A and ran into issues where some libraries need a a newer API then the old phones . tablets have.
1st problem is OkHttpClient. It wants API level 21, I believe I need 16.
Question, Should I go back a B4A version to be compatible with older devices? Or is there a better what to handle it.


 

MarcoRome

Expert
Licensed User
Longtime User
B4X:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="30"/>

in this way your app will already be from android version 4.0 or major
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User

This library requires Android 2.3+.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
This library requires Android 2.3+.
The newest okhttp Library (installed with the newest Ide) requires Android 5+.


Requirements¶

OkHttp works on Android 5.0+ (API level 21+) and Java 8+.
OkHttp depends on Okio for high-performance I/O and the Kotlin standard library. Both are small libraries with strong backward-compatibility.
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Right dear Don, the last release work 5.0+
Anyway maybe it can help you
you can replace the okhttp file with the 4.X compatible version

but i don't know if there are specific contraindications
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Reading also:

 
Upvote 0

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Sorry guys - gals, forgot to post this. I did this last week or so and spaced out updating the thread.
These are the internal libs that need to be replaced for all HTTP stuff to work with Android 4.x
Grab them from the download above @Erel posted.

All is Good!


 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…