Android N Java8 java.time

扶醉桌前 提交于 2019-11-27 15:01:19
Maheshwar Ligade

Android N is not supporting all the features of Java 8. Following features are only supported:

  • Default and static interface methods
  • Lambda expressions
  • Repeatable annotations

Reflection and language-related APIs:

  • java.lang.FunctionalInterface
  • java.lang.annotation.Repeatable
  • java.lang.reflect.Method.isDefault()

and Reflection APIs associated with repeatable annotations, such as AnnotatedElement.getAnnotationsByType(Class)

Utility APIs:

  • java.util.function

For more info check the following link: http://developer.android.com/preview/j8-jack.html

There is backport library of java.time APIs for Android that can be used

https://github.com/JakeWharton/ThreeTenABP

java.time package was added only in API 26 (Android O):

https://developer.android.com/reference/java/time/package-summary.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!