Do you have any idea <@UGCM6H67J>?
# android
s
Do you have any idea @Kris Wong?
k
i have an idea that i haven't cared about Froyo in about 5 years 😛
😀 1
j
ServiceLoader is API 9+
There's no reason to support Froyo devices
s
is there any other way to throw new threads not using GlobalScope in Froyo devices?
j
Do you use R8? It will optimize away the ServiceLoader usage automatically in AGP 3.6 or newer (with coroutines 1.3.0)
s
I use r-link 2
l
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
Serious question: Why would you need to support froyo?
s
I need to make an app running from api v8
a
but why? Is there some hardware you're trying to interact with?
☝️ 1
k
maybe he's making an app to run on the devices at the Museum of Android History 😂
😁 4
🤣 3
y
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
This has changed since project treble (Android 8+). There's now Android Automotive
Android 2.2 on a car: LOL
r
Api 8, no one left on earth has that 😅
d
old good memories. my first android device was on 2.2 still the best version imho (or just a baby duck syndrome)
u
wow,impressive. I can't believe there are some people working on these apis still.
l
Can't even use AndroidX, nor the old support libraries that were API 9+ then API 14+ 😬
🤪 1
e
Sounds like a tough life.