从.vcf文件中的Andr​​oid 2.1导入联系人 [英] Import Contacts from .vcf file in Android 2.1

查看:152
本文介绍了从.vcf文件中的Andr​​oid 2.1导入联系人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够检索机器人在.vcf文件使用的所有联系人以下code。

I am able to retrieve all contacts from android in .vcf file using following code.

    ContentResolver cr = getContentResolver();
    Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null);
String lookupKey = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
                        Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey);
                        System.out.println("The value is " + cr.getType(uri));
                        AssetFileDescriptor fd = this.getContentResolver().openAssetFileDescriptor(uri, "r");
                        FileInputStream fis = fd.createInputStream();

我不知道如何使用这个.vcf文件导入所有这些使用code接触。 .vcf文件包含了所有的联系人包括照片等。

I don't know how to use this .vcf file to import all these contacts using code. The .vcf file contains all the details of all contacts including photos etc.

干杯,
Prateek

Cheers, Prateek

推荐答案

我终于取得了联系方式进口。解决的办法是提取Android源$ C ​​$ C所有相关文件并进行一些改变,它会工作。 : - )

I finally achieved the contacts import. The solution is to extract all the related files from Android source code and make few changes and it will work. :-)

这篇关于从.vcf文件中的Andr​​oid 2.1导入联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆