I am using jdk1.8.0_31. But i cannot implement class in my project YearMonth which introduced in jdk 1.8. My concept on jdk is not clear. Is there any relationship between jdk version vs api version (Compatibility issues) ? Is the all features are inherited in android after release of latest jdk ?
3 Answers
If you go to File/project structure in android studio and for source compatibility select 1.8 you can't because android studio doesn't. This lawsuit explains why google is not so eager to support java for now. As for time/year/month/dates etc. Java 8 has instant for recording times and dates ...
Comments
Minimum SDK level defines what you can use or not. Java 8 is currently not supported by Android. Please refer the below post for more details
Which JDK version (Language Level) is required for Android Studio?
JSR-310is new date time API introduced in Java 8. Android does not ship with Java 8. JodaTime is the recommended library for handling time on Android.