Supported Java 8 Language Features and APIs states that we can use default methods and lambda expressions in android projects with any min sdk API level.
However, the Stream library (java.util.stream) is only supported for API 24 and higher. Can somebody please shed some light on why this is the case? To me it does not make sense, because as far as I understand, the addition of stream API does not require JVM modification unlike the addition of lambdas or default methods; it simply leverages Java 8 features like default methods on collections and adds some new code to java util library?
Can somebody please shed some light on why this is the case?
Because Google does not have a time machine. Or, if they are, they are not using it to "retcon" previous versions of Android.
it simply leverages Java 8 features like default methods on collections and adds some new code to java util library?
Correct. However, Google has no means of changing java.util
classes on previous versions of Android. Even adding new java.util
classes via a library would be a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With