Reputation: 152
According to Android Studio documentation:
Android Studio 3.0 introduces built-in support for Java 8 libraries
But a huge improvement in Java 8 is the use of the new java.time library. For now, this library seems not included in this version.
So my question: I'm I wrong ? If not, is there any workaround possible to use this library in Android applications ?
Upvotes: 2
Views: 912
Reputation: 6598
To get Java 8 language feature support running in Android Studio, check these four things:
Make sure you are running the latest version of Android Studio 3.0
Update your the source and
target compatibility versions to 1.8 in your project structure.
Ensure you minSdkVersion is 24 (or 26/'O' depending on which method you want to use in the class)
Once your project complies with those settings, you can add libraries such as: import java.time.LocalDateTime; to your project. Check out this page for more information: https://developer.android.com/studio/preview/features/java8-support.html
Upvotes: 2