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

Looking up Contact from phone number - Old vs New URI: Old fails, New Succeeds?

I've read related several questions here and can't find the answer to this: I have an Android 2.1 device (HTC Incredible). My app, however, must be compatible with early (pre SDK 5) devices, so I am using the deprecated format of filter URI: Uri…
Bob Denny
  • 1,306
  • 1
  • 11
  • 18
0
votes
1 answer

Android Content resolver Returns all accounts activated in mobile No

While trying to retrieve a contact list from android using the below code it returns multiple accounts like google/gmail, whatsapp, and soma (how many accounts are activated depends on the number content resolver returns for that much copy of…
0
votes
0 answers

Android: Read contacts

I am developing an application in which i am able to read the contacts. I refereed this Link. My code to read contact and basic information is as follow: Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,…
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
0
votes
1 answer

Loader for "Profile" contact's details

I am basing my code on the Login sample supplied with Android Studio. That sample contains code to populate an AutoCompleteTextView with email addresses related to the device's ContactsContract.Profile contact. i.e. the phone's owner, me. I need to…
Richard Le Mesurier
  • 29,432
  • 22
  • 140
  • 255
0
votes
1 answer

onPerformSync called on emulator but not physical device

I've built an Account sync adapter to show contacts from the app in local contact book. There is a fake authonticator that provides account. Also account is syncable ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1); …
dilix
  • 3,761
  • 3
  • 31
  • 55
0
votes
1 answer

Updating dirty raw contact

I created a raw contact which is updated if there is any changes from the contact. Peradventure, the user deletes the raw contact before the next sync, the contact has a dirty flag. From my implementation, in such scenerio, i first clear the flag…
Belvi Nosakhare
  • 3,107
  • 5
  • 32
  • 65
0
votes
1 answer

The best way to get contacts by using ContactsContract

I am trying to get contacts that are visible in my phonebook. Assume there are 5 contacts with number that are saved in my device and 3 contacts with numbers that are saved in my Gmail acount. Also, consider that device contacts span Gmail contacts.…
Dorukhan Arslan
  • 2,676
  • 2
  • 24
  • 42
0
votes
0 answers

Trouble in getting contact's phone numbers by contact id

Here is my code to get data of user from phone's database: Uri contactDataUri = ContactsContract.Data.CONTENT_URI; /*final String[] projection = { ContactsContract.Contacts._ID, Build.VERSION.SDK_INT …
Parth Modi
  • 1,675
  • 2
  • 20
  • 26
0
votes
1 answer

Getting contactdetails from contact Id not working in android

Hello i am working on a contact directory,i have made a custom call logs,Noe i want to display the contact details when one of the contact is clicked,I have first fetched contact_id from the contact number,and then by searching over the internet i…
0
votes
1 answer

Android contact picker query only returning phone number

I'm trying to extract some data from the contact picker, but it seems that all I'm able to get is the phone number. I tried multiple different things, and as I'm still learning Java, I would really appreciate some help. What I want: what I…
Doommius
  • 3
  • 1
0
votes
2 answers

Android ContactsContract with AutocompleteTextview too slow

Am trying to use the ContactsProvider with my AutoCompleteTextview using a method that fetches the data (name and phone number) and stores them in a list. As expected, this method will always take time to complete as am calling the method in the…
Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
0
votes
2 answers

Reading only real contacts

I have a program which reads the contacts and then displays it into the ListView. But the problem is that I have total 25k + contacts in my phone and 60% contacts are of google. So it takes too much time to read contacts. How do I read contacts…
Emma
  • 21
  • 3
0
votes
0 answers

SIM Android Contacts

This is a code i found on other StackOverflow questions, it works well (as they say) for that users asking a question to fetch only the SIM Contacts from and Android phone. However, when i try to build it, Android Studio get a NullPointerException…
0
votes
1 answer

Android - Trouble deleting only contacts with a specified note

I am working on a project that creates random contacts but I am having trouble implementing the deletion capability. I have marked each generated contact with a note through ops.add(ContentProviderOperation …
JGray
  • 293
  • 2
  • 15
0
votes
3 answers

ContactsContract is not returning Phone Number but Name

I have used this code to display the name and the phone number of my phone even though it is returning the name only, I would appreciate any answer. does it also works if i have google account synced? CODE: public class MainActivity extends…
kobbycoder
  • 682
  • 2
  • 10
  • 33