B4X FEED HTTP on API19, API23 and API28

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: HTTP on API19, API23 and API28 است. این موضوع تا کنون 26 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع HTTP on API19, API23 and API28
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
26
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
I'm updating some previously working code which uses the OkHttpUtils2 library.
The code needs to be compatible with android api levels 19, 23 and 28.
Since the code was last compiled there has been an update to the native java OkHttp library and android api level 19 is no longer supported.
On an api 19 device I now see the error:
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
at okhttp3.internal.platform.AndroidPlatform.<clinit>(AndroidPlatform.kt:153
Click to expand...
On an api 23 device the code works fine, and on an api 28 device the code works fine.

I tried switching from OkHttpUtils2 to the older HttpUtils2 library.
This works on api 19 and api 23 but not on api 28 where I see the error:
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.methods.HttpGet" on path
Click to expand...
In api 28 (or some earlier version) Google have removed the old Http library.

I thought I'd detect the device api level at runtime.
If it's...



 

عقب
بالا