Skip to content

Recurrence serialization

maltaisn edited this page Oct 18, 2019 · 1 revision

In order to save the recurrence in a bundle or store the recurrence to permanent storage, you have three choices:

  1. Recurrence is Parcelable and can be written to a Bundle.

  2. RRuleFormat: This is the recommended way of storing recurrences to permanent storage. This class will encode a Recurrence object to a RFC 5545-compliant string that looks like this: RRULE:FREQ=WEEKLY;INTERVAL=10;BYDAY=SU,MO,TU,WE,TH,FR,SA.

    • Encoding: RRuleFormatter().format(Recurrence): String.
    • Decoding: RRuleFormatter().parse(String): Recurrence.
  3. RecurrenceSerializer: Encodes recurrences to a byte array. RRuleFormat is preferred.

    • Encoding: RecurrenceSerializer().write(Recurrence): ByteArray.
    • Decoding: RecurrenceSerializer().read(ByteArray): Recurrence.
Clone this wiki locally