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
2
votes
2 answers

Android: set contact photo with ContactsContract insert intent

I am using ContactsContract to insert a new contact by sending the user to a "New contact" intent. The code I am using is: Intent i = new Intent(Intent.ACTION_INSERT); i.setType(Contacts.CONTENT_TYPE); i.putExtra(Insert.NAME, "Some Contact…
licyeus
  • 101
  • 3
  • 8
2
votes
1 answer

BadParcelableException: ClassNotFoundException when getting name of picked contact

I use the Contact picker to get the name of a specific contact. For Eclair and later I use: startActivityForResult(new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI), CONTACT_PICKER_RESULT); and in onActivityResult() I just…
jonasb
  • 1,847
  • 1
  • 17
  • 15
2
votes
3 answers

Get contacts with email id

I need to get contacts information(cursor) with email. They must be distinct. There must be one entry per contact if he has got an email. How to do it? I am targetting new contacts API comes with 2.0. 1)I tried to do it using CursorJoiner, but a…
Dhruv
  • 1,129
  • 2
  • 13
  • 32
2
votes
1 answer

Android ContactsContract class: How to ignore non-primary ACCOUNT_TYPES?

So I know by now that I can use ContactsContract class to list all contacts available on an android device. Something like this: private void getContacts(){ ContentResolver resolver = getContentResolver(); Cursor cursor =…
data
  • 739
  • 6
  • 17
2
votes
1 answer

How to retrieve every possible contact?

There is multiple examples of how we could retrieve contacts in android the most common type is using ContactsContract like this: ContentResolver resolver = getContentResolver(); Cursor cursor =…
data
  • 739
  • 6
  • 17
2
votes
2 answers

When does setting a contacts image fail via ContentProvider and ContactsContract

I'm trying to update contact images via the ContentProvider in my app. This works nearly always (I use this method for about 4 years in a production app, with ~50000 users and 1M downloads). I nearly never have problems, but it seems like the…
prom85
  • 16,896
  • 17
  • 122
  • 242
2
votes
1 answer

ContactsContract select records by phone number

I can select all contacts using the query below cr = mActivity.getContentResolver(); String selection = ContactsContract.Contacts.HAS_PHONE_NUMBER + " > 0"; String orderBy = ContactsContract.Contacts.DISPLAY_NAME + " ASC "; Cursor…
2
votes
1 answer

Provide contacts from ContentProvider to standard Contact app

I've tried to search, but I even can't ask the question in short form. I have SQLite table with id/username/mobile/email. I've created ContentProvider for it. I've created Account through AccountManager(AccountAuthenticator) All of it working and…
2
votes
1 answer

How to provide whatsapp like functionality inside contacts apps?

Whatsapp provides a hidden feature to the message, voice call or video call any registered user who is also in your contacts list. See the attached image. These options are available on different contacts app as well, so it not the contacts app…
R2D2
  • 31
  • 2
  • 5
2
votes
1 answer

How to check which number is deleted from usercontact which has mutiple contact?

I have added multiple number under different categories for single user like, If I delete the one of the numbers , I want to detect which number got deleted from contact using ContactsContract content uris
Bhoomi Zalavadiya
  • 689
  • 12
  • 26
2
votes
0 answers

How to add/save Postal Address to Contacts in Android Application

Possible Duplicate: How to add postal address to contacts in android programmaticaly? I am trying to save postal address to contacts in my android application, but all I am able to save is email and phone number. Postal address is never saved to…
2
votes
2 answers

ContactsContract lookup Phone Number by Contact Id

I am attempting to lookup the phone number for contacts by their contactId, bll results are returning - Phone Number: 1 I've tried using other examples around SO but I keep getting a 0 count on the cursor Uri uri =…
cynicaljoy
  • 2,047
  • 1
  • 18
  • 25
2
votes
1 answer

How to retrieve the best given name of a User in Android?

I retrieve the display name of a user via the ContactsContract API in Android. Now I want to retrieve the given(first) name of this user. There are specific Rows in the data table that contain the name of the user. The problem is that there are…
Janusz
  • 187,060
  • 113
  • 301
  • 369
2
votes
0 answers

Contact-Sync with Firebase

In my application I try to syncronize the contacts of the Phonebook with the users from Firebase. Therefore I query all contacts from Phonebook with ContactsContract.CommonDataKinds.Phone.CONTENT_URI and iterate through them to check each…
2
votes
1 answer

How to obtain the synced twitter raw contact through the contacts api?

I have a user id from a synced contact, I now try to retrieve the raw twitter accounts that the sync adapter from the official twitter client creates. How would I specify the MIME Type for needed to filter for the Twitter Account? The content of…
Janusz
  • 187,060
  • 113
  • 301
  • 369