1

I'm building an app where I want to display all the instances of an event.

What I'm trying to achieve is to generate dates from the iCalendar object that I'm getting from my REST API. I'm fairly new to Android and Java development, but from what I've understood it would be best to generate Java Calendar class instances, so I can work with them later on.

Do I need to use a RRule parser library like ical4j or biweekly to achieve that or does the Android platform or Java or Kotlin provide a better way?

{
    "_id": "5d5be0929d5dbf00093e3127",
    "userId": "5d3832d6be7eb100076e2883",
    "iCalendar": {
        "frequency": "WEEKLY",
        "tzid": "Europe/Berlin",
        "dtstart": "1566300988998",
        "dtend": null,
        "interval": 1,
        "byDay": "MO"
    }
}
cavpollo
  • 4,071
  • 2
  • 40
  • 64
Louis
  • 11
  • 2
  • previously, we used a library for this, if i remember correctly we used the `ical4j` library because, as I remember it, it just iterates and parses values for you, which you could also be doing manually – a_local_nobody Aug 30 '19 at 13:52
  • well, we specifically had to parse and use recurrence rules, but the format looks very familiar. we ended up using that library to parse stuff, i don't THINK there's an android built-in equivalent for it, because it simply iterates and parses things – a_local_nobody Aug 30 '19 at 13:54
  • 1
    Better than `Calendar` in Java (which is poorly designed and long outdated), use [java.time, the modern Java date and time API](https://docs.oracle.com/javase/tutorial/datetime/). If for Android under API level 26, then the backport, see [How to use ThreeTenABP in Android Project](https://stackoverflow.com/questions/38922754/how-to-use-threetenabp-in-android-project). – Ole V.V. Aug 31 '19 at 08:26

0 Answers0