3 ms·
Yes. In one instance I used Java 17 in an app that ran on as low as Android 4.2, and it did work just fine on an actual Galaxy Nexus. My current app's minSdk is
by grishka 2y ago
Yes. In one instance I used Java 17 in an app that ran on as low as Android 4.2, and it did work just fine on an actual Galaxy Nexus. My current app's minSdk is Android 6. Though there are caveats: you can't use records (because they extend the new class java.lang.Record that desugaring library doesn't contain) and sealed classes (presumably because they require extra checks by the class loader).
edit: records actually work now, with compileSdk set to 35
edit2: and sealed classes now work too. I tested both on a Samsung Galaxy S9 running Android 10, but the decompiled code looks very much Java 6 compatible so it should run on anything