Prateek Jain
2010-11-26 05:11:40 UTC
Hi All,
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();
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.
Cheers, Prateek
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();
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.
Cheers, Prateek
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en