ez-vcard icon indicating copy to clipboard operation
ez-vcard copied to clipboard

Migration to 0.12.0 while still supporting Android API 21..25

Open AndroidDeveloperLB opened this issue 2 years ago • 6 comments

After updating to 0.12.0 , I've noticed that it has some changes that I hope I've found proper alternatives to them:

  1. Doesn't support File class as parameter for VCardWriter and maybe also others. There is Path instead, but it requires API 26 while the app I work on is for Android API 21 and above. Is it ok to use this instead:
vCardWriter = VCardWriter(BufferedOutputStream(FileOutputStream(vcfFile)), VCardVersion.V4_0)

?

Does it auto-close the stream?

  1. The class Birthday doesn't support providing Date class to it. I can't use Temporal as it requires API 26 . Is it ok to convert to PartialDate ? Would work the same? Meaning like this:
val vCard = VCard()
//birthdate is of type Date
val date =
    PartialDate.builder().year(birthdate.year).month(birthdate.month).date(birthdate.date).build()
vCard.birthday = Birthday(date)

I tried to find information on the repository, but found only what has changed, and not how to migrate: https://github.com/mangstadt/ez-vcard/wiki/Changelog

Please help.

AndroidDeveloperLB avatar Feb 05 '23 09:02 AndroidDeveloperLB