0

I want to share contact to my application from phonebook to vcard format. How to take shared-vcard formatted contact information?

Uri streamExtra = sharedIntent.getParcelableExtra(Intent.EXTRA_STREAM);

**Result:** content://com.android.contacts/contacts/as_vcard/profile
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
gruLella
  • 5
  • 5

1 Answers1

0

You can use this library to parse a VCard and extract the info.

An example of how to do this:

VCard vcard = Ezvcard.parse(str).first();
String fullName = vcard.getFormattedName().getValue();
String lastName = vcard.getStructuredName().getFamily();

If you need to share the contact info with another app, you can check this answer

jonathanrz
  • 4,206
  • 6
  • 35
  • 58