Not an Android dev, but got a question: if my mult...
# android
e
Not an Android dev, but got a question: if my multiplatform project targets
jvm()
, how do I make sure it also supports Android?
m
If you're not using any android specific stuff/APIs, then just declaring
jvm
should be enough as java libraries are available to android without any extra effort.
✔️ 2
☝️ 2
e
Bytecode level should be 52 (1.8) right?
m
To be conservative and support as many users as possible, yes. you can also take a look at this section https://developer.android.com/build/jdks#compileSdk to see the compatibility matrix between recent android versions and java versions
e
bytecode level doesn't matter too much if the users are using desugar, which is common. but regardless of the bytecode level, there's some classpath APIs which aren't available even with desugar, so you should avoid them for Android users
☝️ 1
g
Bytecode level should be 52 (1.8) right?
No, Android desugarging supports up to 21 (22 not sure, never checked) But to check if specific API is supported by desugaring, check this doc: https://developer.android.com/studio/write/java8-support-table