I have been reading about the Optional type in Java 8. I want to implement in some of my Android code.
But does the Dalvik machine for the latest versions of Android (5.1 and 6) implement everything in Java 8?
I'm still running Java 7 with the Eclipse and Android Studio installed on my computers.
You can use StreamSupport lib which adds support for the new Streams API and as a side effect it has Optional
.
For gradle use:
compile "net.sourceforge.streamsupport:streamsupport:1.5.1"
Yes. But only on API level 24 / Nougat (in current time of writing).
For pre-Nougat, you may opt to these libraries:
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