Questions tagged [contactscontract]

Android's Contacts API is defined in the android.provider.ContactsContract and related classes.

The Android platform provides a Contacts API for managing and integrating contacts from multiple accounts and from other data sources.

To handle overlapping data from multiple sources, the contacts content provider aggregates similar contacts and presents them to users as a single entity.

ContactsContract defines an extensible database of contact-related information. Contact information is stored in a three-tier data model: Contacts, Raw Contacts and Data.

More information can be found in the documentation for the ContactsContract class.

551 questions
3
votes
1 answer

How to get type of a contact stored in SIMCARD in android version above 4.0?

I want to get all the contacts from sim as well as phone in 4.0 and above ,but with phone type. I saw this link How to get all contacts from phonebook & SIM card in Android? But i am not getting contact type.
Meenal
  • 2,879
  • 5
  • 19
  • 43
3
votes
2 answers

Android contacts custom field

Is it possible to add custom field to some contacts, with custom mimetype (like facebook profile) without writing sync adapter, authenticator and sync service? I do not want to add "synchronization" functionality for my application.
nemezis
  • 536
  • 1
  • 6
  • 21
3
votes
1 answer

Get user/owner profile contact URI and user image with API 8 onwards

From API 14 (Android 4.0 onwards) onwards I can use ContactsContract.Profile.CONTENT_URI to get the phone owner's contact profile Uri, and through that obtain their avatar/contact photo. I want to know how to do this from API 8 (Android 2.2) through…
Iskar Jarak
  • 5,136
  • 4
  • 38
  • 60
3
votes
2 answers

How to show sync failed message

I've build a contacts sync adapter. It's all working fine but I need one more thing. If for some reason the sync does not complete successfully, I want to show a message like Google account is showing when the sync fails
3
votes
2 answers

Why am I unable to update the email address in android?

ArrayList ops = new ArrayList(); ops.clear(); ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI) .withSelection(Data._ID + "=?", new…
3
votes
1 answer

Android contact list get address

in my app (android 4.0) i need to retrieve the address from a contact. I used the solution provided in another post here: Uri contactData = data.getData(); Cursor c = managedQuery(contactData, null, null, null, null); if (c.moveToFirst()) { …
Jim Panse
  • 159
  • 2
  • 11
3
votes
2 answers

Android ContactsContract.Directory API

I am trying to select a phone number from a global address book (Corporate account). I would like to use the native picker/API because I don't want to prompt the user for login credentials. I came across the ContactsContract.Directory API. …
radium22
  • 155
  • 1
  • 9
2
votes
0 answers

Query with multiple uri's

Uri contactUri1 = Uri.withAppendedPath( ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number1)); Cursor phones = getContentResolver() .query(contactUri1, PEOPLE_PROJECTION, null, null, null); This works. I can get what I need…
yildirimyigit
  • 3,013
  • 4
  • 25
  • 35
2
votes
1 answer

Address format in Honeycomb / ICS

I have an app which can retrieve the mailing address from contact information on the device. I retrieve the information for street address, post code, city etc. using the contacts API using code similar to below. I then display the address on…
Mr. K
  • 21
  • 3
2
votes
4 answers

Load a contact's picture into a listview instead of the default?

I created a listview containing my contacts... tab_contact_list.xml, contains the listview:
Thuong Nguyen
  • 43
  • 1
  • 5
2
votes
2 answers

Set QuickContactBadge image to contact's profile picture

I'm using a QuickContactBadge and want it to display the contact's profile picture. This is how I'm loading the contact info: Uri contactUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactId)); …
Henrique
  • 4,921
  • 6
  • 36
  • 61
2
votes
2 answers

Where to save checkbox selected contacts in ListActivity?

I am using a custom List adapter to display a list of all contacts, and the user will then select contacts by clicking a checkbox. What is a good method of saving the selected contacts to preferences, so that I may test against them elsewhere? I was…
benbeel
  • 1,532
  • 4
  • 24
  • 38
2
votes
1 answer

Android - Receive Contacts changes on telephone

Is it possible to have a broadcast receiver or service to be notified when a phone contact is added, deleted or modified? I am making an application that needs fast access to phone contact, for what i was thinking of one copy sqlite phone contacts…
itaravika
  • 391
  • 1
  • 6
  • 17
2
votes
1 answer

Loading contact photos into contact list: random contact photos appear in wrong places

I have loaded my contacts into a list using extended SimpleCursorAdapter and now I'm trying to load the contact photos. When running the code random contact photos appear next to random contacts, even for those who don't have photos. Why doesn't it…
RufusInZen
  • 2,119
  • 1
  • 19
  • 26
2
votes
1 answer

Indicator of new created Contacts

Is there any indicator besides RawContacts.VERSION and RawContacts.DIRTY that tells me if a new contact has been created? Right now I check the contactdatabase for "DIRTY"-contacts and then if the VERSION field is greater two it's a changed contact…
Christoph Haefner
  • 1,093
  • 1
  • 9
  • 25