contacts

Contacts created with Android emulator (2.0) not being seen

吃可爱长大的小学妹 提交于 2019-12-11 15:42:53
问题 I created contacts with the emulator for v 2.0. However, I am unable to see these contacts. One of the errors I get even before my code that executes read contacts is: Cannot determine the default account for contacts compatibility See below for full stack: E/ContactsProvider( 109): Cannot determine the default account for contacts compatibility E/ContactsProvider( 109): android.accounts.AuthenticatorException: bind failure E/ContactsProvider( 109): at android.accounts.AccountManager

Syntax error when querying contacts database for an email

自闭症网瘾萝莉.ら 提交于 2019-12-11 14:47:59
问题 I am trying to do a search through the contacts database for an email address and get the contact ID of that person if it finds it but everytime I try I get a syntax error 01-03 17:15:10.574: E/AndroidRuntime(7907): java.lang.RuntimeException: Unable to start receiver com.app.notifyme.GmailReciever: android.database.sqlite.SQLiteException: near "@gmail": syntax error: , while compiling: SELECT raw_contact_id FROM view_data data WHERE (1) AND ((data1=johnsmith@gmail.com)) 01-03 17:15:10.574: E

How do you retrieve ONLY the select property from your iOS contacts?

Deadly 提交于 2019-12-11 13:47:48
问题 we're having an issue where incorrect selections are being returned from the contacts database on some devices. Is there a way to modify the below code to only return the selected item from a persons contact information? In this case we want the exact selected email address from a persons contact to be returned. Thanks in advance for the help! Heres the code... -(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:

How do I get the count of SMS messages per contact into a textview?

巧了我就是萌 提交于 2019-12-11 13:14:13
问题 I have a listview that displays the contacts on my device. What I'm trying to do is display the number of text messages my device has received from each contact into a textview within my listview. I have only been able to display the total number of text messages within my inbox from this code: // gets total count of messages in inbox String folder = "content://sms/inbox"; Uri mSmsQueryUri = Uri.parse(folder); String columns[] = new String[] {"person", "address", "body", "date","status"};

Effective way to get contacts info with photo

守給你的承諾、 提交于 2019-12-11 11:57:10
问题 I want to get some basic info of all contacts(I use api lvl 8). Currently i use this code snippet private List<ContactInfo> readContacts() { ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, Phone.DISPLAY_NAME + " ASC"); for (int i = 0; i < cur.getColumnCount(); i++) { Log.v("COlum", cur.getColumnName(i)); } List<ContactInfo> temp = new ArrayList<ContactInfo>(); if (cur.getCount() > 0) { while (cur.moveToNext()) {

hyphens are an issue in getting contact details with a partial phone number

依然范特西╮ 提交于 2019-12-11 11:16:22
问题 I have a function to get all contacts with part of a phone number, here... Cursor c = getContentResolver().query(Data.CONTENT_URI, new String[] {Data._ID, Phone.NUMBER}, Phone.NUMBER + " like ?", new String[] {"%"+String.valueOf(phoneNumber) +"%"}, null); while (c.moveToNext()) { String id = c.getString(0); String number = c.getString(1); Log.d("id",id); Log.d("number",number); } but the problem is - IF i insert 31221 I can't get contacts with a phone number like 312-2131-321 Because of "-"

Update existing contact with image in Android

自闭症网瘾萝莉.ら 提交于 2019-12-11 10:54:10
问题 I am able to update image in contact from my app and its visible in contacts but as soon as google sync occurs it deletes the image from contact. My code: ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI) .withValue(ContactsContract.Data.RAW_CONTACT_ID, lRawContactId) .withValue(ContactsContract.Data.IS_PRIMARY, 1) .withValue(ContactsContract.Data.IS_SUPER_PRIMARY, 1) .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM

How to create a contact in the “local” addressbook?

南楼画角 提交于 2019-12-11 10:01:01
问题 I am wanting to create a contact programmatically into the "local" addressbook (so that it doesn't try to synch, which causes some compatibility issues with Exchange). If a local addressbook already exists, I can find it using ABAddressBookCopyArrayOfAllSources to get all the sources in the Address Book, then look for the ABRecordRef with a sourceTypeRef of "kABSourceTypeLocal"- if I then pass that recordRef to ABPersonCreateInSource, I can add a record to the local directory. Does anyone

check mobile number valid or not through country code

╄→гoц情女王★ 提交于 2019-12-11 09:46:58
问题 I have contact like "+919672525253".Now i extract the country code like "91" from that number.Now if number is like "9672525253" and if i extract the country code then it will give me "967".So after extracting the country code how can i check that remaining number is valid mobile number for that country code or not? EDIT If any body know the mobile number length country wise then also i can solve this problem.like in india 10 digits. 回答1: You pretty much can't. For example in the US mobile

Trying to read Windows 7 Contacts doesn't work

吃可爱长大的小学妹 提交于 2019-12-11 07:55:32
问题 I based my code on http://msdn.microsoft.com/en-us/library/ms735866.aspx which is quite bugged, after some adaptation of function CreateNewContact() I tried the following. I don't have errors anymore but nothing is happening : IClassFactory* pFactory = NULL; HRESULT rc; rc = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if (rc == S_OK) rc = CoGetClassObject(CLSID_Contact,CLSCTX_INPROC_SERVER,NULL,IID_IClassFactory, (void **) &pFactory); if (rc == S_OK) rc = CreateNewContact( pFactory); if