Android contatcs vcard API

前端 未结 1 2026
礼貌的吻别
礼貌的吻别 2021-01-06 14:05

Is there any android API to extract contacts in vcard 3.0 format ? I have come across an open-source vcard project android-vcard

but in the usage Example

相关标签:
1条回答
  • 2021-01-06 14:23

    This works with Eclair (>= Android 2.0) and I guess its somewhat this functionality the examples page describes

    Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey);
    AssetFileDescriptor fd = resolver.openAssetFileDescriptor(uri, "r");
    FileInputStream fis = fd.createInputStream();
    byte[] b = new byte[(int)fd.getDeclaredLength()];
    fis.read(b);
    String vCard = new String(b);
    sb.append(vCard);
    
    0 讨论(0)
提交回复
热议问题