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

Retrieve contacts from android only where phone number consists 123 in it

I am trying to work on a project where I require all contacts of a phone which has 123 in its phone number. I am able to retrieve the contacts but "where" clause in contentresolver isn't working here's my code for reference public void…
0
votes
1 answer

Android: Show all contacts sorted by favorites

I know how to fetch all contacts as well as how to fetch the favorited contacts. Is there a way to combine the two and sort by favorites? getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "starred=?", new String[]…
0
votes
3 answers

Retrieve Contact info from Android Contact Provider

I'm trying to retrieve data from the Contact provider but the data shows seems not query correctly. The code I use is just below: mCursor = mContext.getContentResolver().query( ContactsContract.Data.CONTENT_URI, null, null, null,…
Seb
  • 2,929
  • 4
  • 30
  • 73
0
votes
1 answer

BroadcastReceiver to listen when a contact added or deleted from favorite/stared

Is there a way to listen/handle at the time when a contact is added/deleted from favorite/starred contact list. I have checked for onChange(). But its not handling the Favorite/Starred settings.
0
votes
1 answer

ContactsContract.Contacts issue, duplicates

I've been doing research on this but I can't figure it out. My contacts in my phone in a sample app I downloaded are often duplicated, like so: I'm quite sure it has something to do with ContactsContract.Contacts. I've read up on it but don't know…
CHarris
  • 2,693
  • 8
  • 45
  • 71
0
votes
0 answers

Duplicate contacts are listed while reading device contacts

I am trying to read contacts from device. I am getting the list of device contacts , but the problem is most of them are duplicates. But in my default contacts app those duplicates are not there. Right now it is returning around 1150 contacts from…
dev
  • 1,085
  • 4
  • 19
  • 26
0
votes
0 answers

Android after getting user's contacts into a list, Can't use them

I've manged to use the following code for retrieving user's contacts into a list, and now I'm working on the next step (getting individual info of each contact): package com.example.mycontacts; import android.app.LoaderManager; import…
Dgotlieb
  • 1,393
  • 2
  • 9
  • 15
0
votes
1 answer

Android 2.2; Can you query from 2 different URIs at the same time?

If you want to obtain contacts data from two separate URIs, can you do this in a single query? For example : ContentResolver cr; Cursor emailCur = cr.query( ContactsContract.CommonDataKinds.Email.CONTENT_URI, …
Jimmy
  • 16,123
  • 39
  • 133
  • 213
0
votes
1 answer

Contacts.Photo.PHOTO Constant is working properly in API 10

I am using Contacts.Photo.PHOTO column name of android.provider.ContactsContact.Contacts class to get photo of phone contact. Minimum sdk-version of my application is 10, so when using this constant it gives me warning of 'This API added in 11…
pratik03
  • 651
  • 2
  • 7
  • 23
0
votes
1 answer

Find only device contact using CursorLoader

i am create an application which use contact to display. My problem is that i can show all conacts (from my email accounts,skype and other), but i want show only contacts from my device (with images like i am getting now), like when open native…
Alexandro
  • 170
  • 3
  • 12
0
votes
1 answer

Issue fetching emails from contacts in Android

I am fetching all the contacts of my phone and showing them in listview. All the other required details are shown properly but I am having issue in fetching email address. I have many contacts which have email address associated with them but it…
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
0
votes
1 answer

How to get contacts from contact list in Android? using Contact Provider

I had to fetch contact list from android using contact provider, but it was showing me duplicate entries. So, How can I filter those duplicate entries. For example, ABCD - 123467890, 1234567890, 1234567890 how to filter duplicate phone number using…
0
votes
1 answer

Android - How to relink app data with contacts after changing phones/resetting phone

Question How to relink my apps internal data to the new local contacts database, after getting a new phone or after factory resetting the phone? Informations My app uses the phones contacts and links all it's internal data to the contacts via the…
prom85
  • 16,896
  • 17
  • 122
  • 242
0
votes
1 answer

Is it possible to add another sync account to an existing contact in android?

What I want to do is creating a sync app and I'm doing it based on sync framework guideline now I am in a point that I don't want to do all the tedious job hence looking for a shortcut. I want to add my sync account to existing contacts rather than…
Vahid Hashemi
  • 5,182
  • 10
  • 58
  • 88
0
votes
1 answer

Add a contact to two gmail sources programmatically in Android

I have two gmail accounts, (abc@gmail.com and xyz@gmail.com) synced with my Android. How can I add a contact that should be synced to both the accounts? Using below mentioned code I am able to add contacts to only one gmail account. private void…