abaddressbook

Get a list of all contacts on iOS

你离开我真会死。 提交于 2019-11-26 03:29:29
问题 I want to get a list of all contacts of an iPhone. I checked Address Book reference, I may missed something but I didn\'t see it provides a method to get a list of contacts. 回答1: Perhaps ABPerson function ABAddressBookCopyArrayOfAllPeople might do? Example: ABAddressBookRef addressBook = ABAddressBookCreate( ); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople( addressBook ); CFIndex nPeople = ABAddressBookGetPersonCount( addressBook ); for ( int i = 0; i < nPeople; i++ ) { ABRecordRef

App crashed in iOS 6 when user changes Contacts access permissions

杀马特。学长 韩版系。学妹 提交于 2019-11-26 02:57:01
问题 I have an app that uses the Address Book. When running in iOS 6 it runs this code when the user does something that requires Address Book access. if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { if (granted) { showContactChooser(); } }); CFRelease(addressBookRef); } else if

Android fetch all contact list (name, email, phone) takes more then a minute for about 700 contacts

别来无恙 提交于 2019-11-26 00:55:34
问题 Is there any way to shorten this time? I\'m running with the cursor and takes the name, phone numbers and emails if I remove the phone numbers query from the query loop it ends in 3 seconds any idea how can I improve that query? Maybe I\'m doing something wrong in my query? (Obviously I\'m doing it async but still... it\'s a very long time that a user can\'t wait) Hope someone can share his thoughts about this this is my code ContentResolver cr = getContentResolver(); Cursor cur = cr.query

Android fetch all contact list (name, email, phone) takes more then a minute for about 700 contacts

笑着哭i 提交于 2019-11-25 19:29:36
Is there any way to shorten this time? I'm running with the cursor and takes the name, phone numbers and emails if I remove the phone numbers query from the query loop it ends in 3 seconds any idea how can I improve that query? Maybe I'm doing something wrong in my query? (Obviously I'm doing it async but still... it's a very long time that a user can't wait) Hope someone can share his thoughts about this this is my code ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); if (cur.getCount() > 0) { while (cur