https://kotlinlang.org logo
#android
Title
# android
s

Sergey

08/20/2019, 2:23 PM
Do you have any idea @Kris Wong?
k

Kris Wong

08/20/2019, 2:24 PM
i have an idea that i haven't cared about Froyo in about 5 years 😛
😀 1
j

jw

08/20/2019, 2:28 PM
ServiceLoader is API 9+
There's no reason to support Froyo devices
s

Sergey

08/20/2019, 2:33 PM
is there any other way to throw new threads not using GlobalScope in Froyo devices?
j

jw

08/20/2019, 2:34 PM
Do you use R8? It will optimize away the ServiceLoader usage automatically in AGP 3.6 or newer (with coroutines 1.3.0)
s

Sergey

08/20/2019, 2:36 PM
I use r-link 2
l

louiscad

08/20/2019, 3:00 PM
If you can't use R8 and really, reaaaly need to run below API 9, you can copy paste the following code: https://github.com/LouisCAD/Splitties/blob/de82f24a60bb92198a120634971c41e86dc72c24/modules/lifecycle-coroutines/src/androidMain/kotlin/splitties/lifecycle/coroutines/AndroidMainDispatcher.kt#L21 plus
val mainHandler = Handler(Looper.mainLooper())
to make it compile. That will allow you to use
Dispatchers.MainAndroid
which doesn't depend on ServiceLoader.
❤️ 1
a

alexsullivan114

08/20/2019, 5:58 PM
Serious question: Why would you need to support froyo?
s

Sergey

08/20/2019, 6:50 PM
I need to make an app running from api v8
a

alexsullivan114

08/20/2019, 6:55 PM
but why? Is there some hardware you're trying to interact with?
☝️ 1
k

Kris Wong

08/20/2019, 6:56 PM
maybe he's making an app to run on the devices at the Museum of Android History 😂
😁 4
🤣 3
y

Yury Lunev

08/20/2019, 8:25 PM
Guys, stuff like Renault cars tend to have long development cycles (7+ years) hence old Androids on them. And someone has to support them 😉
l

louiscad

08/20/2019, 8:54 PM
This has changed since project treble (Android 8+). There's now Android Automotive
Android 2.2 on a car: LOL
r

rkeazor

08/20/2019, 9:19 PM
Api 8, no one left on earth has that 😅
d

deviant

08/21/2019, 9:42 AM
old good memories. my first android device was on 2.2 still the best version imho (or just a baby duck syndrome)
u

Umur Kaya

08/21/2019, 9:52 AM
wow,impressive. I can't believe there are some people working on these apis still.
l

louiscad

08/21/2019, 10:52 AM
Can't even use AndroidX, nor the old support libraries that were API 9+ then API 14+ 😬
🤪 1
e

efemoney

08/24/2019, 9:59 PM
Sounds like a tough life.