import-contacts

How to import contacts from VCF file by using code

偶尔善良 提交于 2019-11-28 00:36:32
I have create a vcf file that contains contacts by using this 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(); how can I import this file into the

How to get contacts detail of iphone and make CSV file of that contact

萝らか妹 提交于 2019-11-27 13:16:35
问题 I want to get contact details in an iPhone with information like First Name, Last Name, Phone Number, Phone Number Type, Email Address, Email Address Type etc.. Can anyone help me with that? I want to make a .csv file out of the contact details in a particular iPhone. I want to fetch iPhone address book data. 回答1: Following is the code to get all informations of iPhone contact book... -(void)collectContacts { NSMutableDictionary *myAddressBook = [[NSMutableDictionary alloc] init];

string replace phone number iOS swift

China☆狼群 提交于 2019-11-27 03:42:55
问题 I import a phone-number from "Contacts" and save in NSString . this string contains white-space and I try to delete them using the method: numero = numero.stringByReplacingOccurrencesOfString(" ", withString: "") this method doesn't work. func sostituisci( stringa: NSString! ) -> NSString { var numero: NSString = "" NSLog(stringa) numero = ((stringa as String).stringByReplacingOccurrencesOfString(" ", withString: "") as NSString) NSLog(numero) return numero } the output unchanged log 2014-11

How to import contacts from VCF file by using code

♀尐吖头ヾ 提交于 2019-11-26 21:45:39
问题 I have create a vcf file that contains contacts by using this 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()