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.


2022sss-06-22_16-02-26.jpg
 
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

This library requires Android 2.3+.
 
Upvote 0
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
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
Reading also:

What about Android 4.x?​

Google’s shows that ~11% of the devices that visited the Play Store in October 2018 were running Android 4.x. We’ve created a branch, OkHttp 3.12.x, to support these devices. Should we encounter any severe bugs or security problems we’ll backport the fixes and release. We plan to maintain this branch through December 31, 2020.
 
Upvote 0
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! :)


11111112022-07-11_15-31-30.jpg
 
Upvote 0
I am also attempting to write for 4.x for the same reasons as above. The link in #10 is no longer active.

Erel, can you please repost that 11.2 version?
 
Upvote 0
Upvote 0
Back
Top