I have created an application for ContactsContract… I have created a spinner which brings all the accounts configured and hence the user can pick up the contact type say, gmail(com.google), phoneBook and so on….
Now, If I select phoneBook, then the contact gets added in the phoneBook perfectly.
When I select gmail option, It works perfectly on my htc cell phone… The contact gets added, and after sync, I can see that in my gmail account too.
But, the same thing when I test on any of the samsung cell phones, it does not get added to the contacts of my gmail….
I am confused…
Any help is appreciated. Thanks in advance…
Phone numbers are stored in their own table and need to be queried separately. To query the phone number table use the URI stored in the SDK variable ContactsContract.CommonDataKinds.Phone.CONTENT_URI. Use a WHERE conditional to get the phone numbers for the specified contact.
Perform a second query against the Android contacts SQLite database. The phone numbers are queried against the URI stored in ContactsContract.CommonDataKinds.Phone.CONTENT_URI. The contact ID is stored in the phone table as ContactsContract.CommonDataKinds.Phone.CONTACT_ID and the WHERE clause is used to limit the data returned.
Email Addresses
Querying email addresses is similar to phone numbers. A query must be performed to get email addresses from the database. Query the URI stored in ContactsContract.CommonDataKinds.Email.CONTENT_URI to query the email address table.