What date class should I use in Android?

I am creating a small calendar application with some specific features for my user base, but I'm not sure which calendar is best to use. I used the Calendar inner class, but recently noticed that I probably should have used GregorianCalendar.

So, I'm going to change the calendar, but would like to know if I should use the calendar, or if there is any better alternative. I was looking a bit for JodaTime , but it seems to have performance issues on Android phones. I also found a library called Date4J . Anyone who has tested any of them on Android and can recommend them? Or should I stick with inner classes?

+3
source share
2 answers

android.text.format.Time is a "faster replacement for the java.util.Calendar and java.util.GregorianCalendar classes." This is what I prefer to use if I don't want some of the fantastic things being offered by Joda-Time .

+1
source

I wanted to add the above answer (android.text.format Time), I need to reconsider, since Google is deprecated from the library by API 22 due to the fact that it is not thread safe. They recommend Gregorian again, which is very strange.

I would suggest looking at Joda Time as it is thread safe and can be used on Android.

(ref: http://developer.android.com/reference/android/text/format/Time.html)

0

All Articles