Reputation: 145
I'm making a small Calendar application with some specific functions for my userbase but I'm not sure which calendar that is best to use. I've been using the internal Calendar class so far but recently noticed that I probably should have used GregorianCalendar instead.
So I'm about to change Calendar but wanted to know if thats the calendar I should use or if there is any better alternative. I was looking a bit at JodaTime but it seem to have some performance problem on Android phones. I also found a library called Date4J. Anyone who has tested either of them on Android and can recommend them? Or should I stick with the internal classes?
Upvotes: 3
Views: 1751
Reputation: 1462
I wanted to add the the above answer (android.text.format Time) needs to be reconsidered as Google have deprecated the library as of API 22 due to it being not thread safe. They are recommending Gregorian again, which is very odd.
I would suggest looking at Joda Time as it is thread safe and can be used in Android.
(ref: http://developer.android.com/reference/android/text/format/Time.html)
Upvotes: 0
Reputation: 67003
android.text.format.Time is "a faster replacement for the java.util.Calendar and java.util.GregorianCalendar classes". It's what I prefer to use, unless I want some of the fancy things offered by Joda-Time.
Upvotes: 1