diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt index 03e65cbe..670aedad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/Constants.kt @@ -46,6 +46,7 @@ const val ADR = "ADR" const val NOTE = "NOTE:" const val ORG = "ORG:" const val TITLE = "TITLE:" +const val URL = "URL:" const val ENCODING = "ENCODING" const val BASE64 = "BASE64" const val JPEG = "JPEG" diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfExporter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfExporter.kt index 80e503eb..bd573b75 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfExporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfExporter.kt @@ -71,6 +71,10 @@ class VcfExporter { out.writeLn("$TITLE${contact.organization.jobPosition.replace("\n", "\\n")}") } + contact.websites.forEach { + out.writeLn("$URL$it") + } + if (contact.thumbnailUri.isNotEmpty()) { val bitmap = MediaStore.Images.Media.getBitmap(activity.contentResolver, Uri.parse(contact.thumbnailUri)) addBitmap(bitmap, out) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfImporter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfImporter.kt index c1938d19..f1c45102 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/VcfImporter.kt @@ -91,6 +91,7 @@ class VcfImporter(val activity: SimpleActivity) { line.toUpperCase().startsWith(PHOTO) -> addPhoto(line.substring(PHOTO.length)) line.toUpperCase().startsWith(ORG) -> addCompany(line.substring(ORG.length)) line.toUpperCase().startsWith(TITLE) -> addJobPosition(line.substring(TITLE.length)) + line.toUpperCase().startsWith(URL) -> addWebsite(line.substring(URL.length)) line.toUpperCase() == END_VCARD -> saveContact(targetContactSource) isGettingPhoto -> currentPhotoString.append(line.trim()) } @@ -251,6 +252,10 @@ class VcfImporter(val activity: SimpleActivity) { curJobPosition = jobPosition } + private fun addWebsite(website: String) { + curWebsites.add(website) + } + private fun saveContact(source: String) { val organization = Organization(curCompany, curJobPosition) val contact = Contact(0, curPrefix, curFirstName, curMiddleName, curSurname, curSuffix, curPhotoUri, curPhoneNumbers, curEmails, curAddresses, curEvents,