Search code examples
androidjava-8java-timeandroid-7.0-nougat

Android N Java8 java.time


I updated to the latest Android N sdk. The only thing I don't understand is why I cannot import java.time into my code? I thought Java8 is available through Android N. Then why didn't Google add java.time package?


Solution

  • 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