android读取vcf文件

  try {
                    File file = new File(Environment.getExternalStorageDirectory() + "/yf_c/1.vcf");
                    List vcards = Ezvcard.parse(file).all();
                    Log.v(TAG, "联系人数量:" + vcards.size());
                    for (int i = 0; i < vcards.size(); i++) {
                        VCard vcard = vcards.get(i);
                        String vcfName = replaceBlank(vcard.getFormattedName().getValue());
                        String vcfPhone = replaceBlank(vcard.getTelephoneNumbers().get(0).getText());
                        Log.v(TAG, vcfName + vcfPhone);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }

资源jar已经上传到我的资源
附上
Stack Overflow上的vcf 相关操作说明

你可能感兴趣的:(读书笔记)