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
0
votes
1 answer

Where did Contacts.Groups.GROUP_MY_CONTACTS go?

I'm working on an app that deals with contacts, and I am looking for ContactsContract compatible equivalents to both of these constants: Contacts.Groups.GROUP_MY_CONTACTS Contacts.Groups.GROUP_ANDROID_STARRED I find it hard to believe that these…
Jesta
  • 1,387
  • 2
  • 9
  • 9
0
votes
1 answer

Update an email with ContactsContract when the contact doesn't have

I want to update the mail address of a contact, it seem working but I the case who the contact have not a mail address it's not working and I have this error : ################################################################# W/System.err: Error…
Jéwôm'
  • 3,753
  • 5
  • 40
  • 73
0
votes
1 answer

Contacts Provider: How to hide Contacts by default from List

This may not be something that is possible but I have tried a few things. I have attempted to set the contacts from my provider into a group that is set to not visible (GROUP_VISIBLE, 0). However, without fail they still show up in the contacts…
Zach S.
  • 130
  • 1
  • 9
0
votes
1 answer

How to distinguish between Telephonenumber and Mobilephonenumber

I have the following problem: I have a RawContactID and want to get every information about this contact. I run a query like this: String selection = ContactsContract.RawContactsEntity.RAW_CONTACT_ID +" = ?"; String[] selectionArgs = new…
Christoph Haefner
  • 1,093
  • 1
  • 9
  • 25
0
votes
1 answer

phone number attaches to the existing contact when inserting new contact into android contacts

I am developing a sync adapter to sync contacts in the phone with an ERP system. Everything works fine on the emulator, but on the phone I get new phone numbers attached to already existing contacts which were created "by hand". int…
0
votes
3 answers

Access the internal addressbook

For more than two days now, I'm trying to grab a list of all contacts, from the internal addressbook (no facebook-, gmail- or twittercontacts) with their family- and givenname. I managed to get a list with all contacts, socialcontacts included. So I…
Christoph Haefner
  • 1,093
  • 1
  • 9
  • 25
0
votes
1 answer

Adding two or more addresses using contactsContract in android

How can i add two or more addresses using contacts contract? I have three postal addresses to add but i don't see any secondary_address like one for phone/Email. Can anybody assist me with this? Thanks!!
user484691
  • 381
  • 7
  • 19
0
votes
1 answer

Recent contacts fetching recent call logs gives error

I have an application which shows recent contacts of phone. so i used the below code to fetch recent contacts but when i tried to run it gives me following error. java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. …
0
votes
1 answer

How to query for all sms messages by a specific user when you have the contact ID

How do you retrieve all the sms messages from a specific contact? I seen ways to retrieve all sms messages and then filter down to the person in particular. But I want to query using the contact id/phone number. I'm querying the contact using…
dumbkam
  • 379
  • 3
  • 11
0
votes
1 answer

Android Contact Check if a contact has an email id

I got the way to check if a contact has a phone number by using HAS_PHONE_NUMBER ContentResolver ContntRslverVar = getContentResolver(); Cursor ContctCorsorVar = ContntRslverVar.query(ContactsContract.Contacts.CONTENT_URI, null, null, null,…
Sujay U N
  • 4,974
  • 11
  • 52
  • 88
0
votes
2 answers

How to get the id of the contact on Android contact list?

Hey, I want to get the id of the contact which is in the list of contacts on Android. I mean, when I add a contact to the phone, I think it has an Id, what is the class that provides this parameter? I mean the exactly Id. I've search if some…
rogcg
  • 10,451
  • 20
  • 91
  • 133
0
votes
1 answer

ContactsContract: update RawContact ignores display_name

When updating a ContactsContract.Data StructuredName row for a RawContact, my code sets the DISPLAY_NAME column with a value provided by the user. It also updates the first, middle, last with values provided by the user. When fetching the contact…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
0
votes
1 answer

Extending / Reimplementing Applications

Ultimately I wish to produce a compressive Contact Manager with some specific features. I thought it would be good to experiment by extending Contact. So using git I checked out froyo-release and tried to build it. That didn't work so well as it…
phreed
  • 1,759
  • 1
  • 15
  • 30
0
votes
0 answers

How to add connection of Android application with existing phonebook contact programmatically like facebook, whatsapp, freecharge etc?

I have tried using [this][1] [1]: Adding new connection to existing android contact to update existing contact with my app's connection. but it is adding new contact with same details and no account connection is getting added to it :( Please tell…
Vrushali Sabnis
  • 197
  • 2
  • 12
0
votes
0 answers

Get phone number from Contacts - Crashes in my onActivityResult method when using ContactsContract

I created an onActivityResult method. I am in the contact list, Upon clicking I should get the name and the phone number of the contact, but it crashes. @Override protected void onActivityResult(int reqCode, int resultCode, Intent data) { …