2

I have just started trying to use the new Java Date Time API but when I went to import the classes like below,I get cannot resolve symbol.

import java.time.LocalDate;

After a little bit of checking it I found that I need to enable java 8 (See below link).

https://developer.android.com/guide/platform/j8-jack.html

I assume this link is still relevant, info gets out of date very quickly. I am using a AS 2.1.3 and JDK 1.8 both installed yesterday (Not sure if that tells you anything).

I just want to make sure that if I go through the process of doing this, will it affect older model devices (In this case I will use Joda Time) or i1s the Java version totally irrelevant to the device.

Thanks

Nicholas Muir
  • 2,897
  • 8
  • 39
  • 89

1 Answers1

3

Back-ports

Much of the java.time functionality built into Java is back-ported to Java 6 & 7 in the ThreeTen-Backport project.

ThreeTenABP

Further adapted to Android in the ThreeTenABP project. See: How to use ThreeTenABP in Android project.


The Joda-Time project is in maintenance mode. The team advises migration to the java.time classes.

Community
  • 1
  • 1
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154