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

How to get Contact Groups into Contact Manager Sample App?

I am running the Contact Manager sample app from the Android SDK. When I add a contact to my Gmail account, it gets added as an 'invisible contact'. I am assuming this is because I am not telling the contact which 'group' it should be assigned to. I…
Chris
  • 5,485
  • 15
  • 68
  • 130
2
votes
1 answer

Get Last Updated Time Of Contacts In Android programmatically

I had been trying to write a android program which sync the contacts over the server. I have achieved the syncing part Now I want to maintain the diff part such as only those contacts who have been updated since the last server push may gets pushed…
Deepak Sharma
  • 458
  • 9
  • 21
2
votes
1 answer

Provide Contact Info For Unknown Number

You know when an unknown number calls you and instead of the number you see the name of the company which is actually calling you. As far as I know Android gets this information through some google services. What should I do if I want to make an…
2
votes
1 answer

Add app link in existing contact profile android

I am working on a application where i need to add my app link just like freecharge or whatspp in phone's existing contact profile without creating new. I tried doing this with the following code public static void addContactTag(Context context,…
Kushminder Garg
  • 518
  • 1
  • 6
  • 14
2
votes
3 answers

Android ContactsContract.Contact missing constants from the API?

I've been using the ContactsContract api for some time now and I've come across two "columns" listed in the API page for ContactsContract.Contacts that do not appear to actually be assessable. The values are (under the columns…
2
votes
1 answer

Select Contact from ListView and get their phone numbers in Android

I am working on Android activity in which I have to select contacts from ListView and write their numbers in .csv file. However I managed to write all contacts numbers from contacts on button click. But now I want to select contact from ListView and…
Addi.Star
  • 475
  • 2
  • 15
  • 36
2
votes
2 answers

How to use the contact pictures synced by Facebook for Android

I'm having Facebook for Android on my phone which automatically synces the FB profile pictures of the people in my contact list to my phone. I'd like to use those pictures within my app where I access ContactsContract.PhoneLookup. Do I really need…
Dennis Winter
  • 2,027
  • 4
  • 32
  • 45
2
votes
1 answer

How to retrieve all contacts details from Content provider with single query?

I need to read the contacts from device. The fields I required are ID , Display Name, Phone Number (All types) Email id (All types) and 'photo'. For this right now I am doing like this. 1 : First I am reading all the ids from…
2
votes
1 answer

Android deleted rawcontacts re-appear and WhatsApp contacts does not apprear

I'm adding contacts with ops.add(ContentProviderOperation.newInsert( ContactsContract.RawContacts.CONTENT_URI) .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null) .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null) …
Alex Martian
  • 3,423
  • 7
  • 36
  • 71
2
votes
1 answer

How to add new field to a contact in android

I want to add new email address to an exist contact. I use this code: ArrayList insertEmailList = new ArrayList(); Uri uri=null; for (ContactEmail contactEmail : emails) { …
eliasetm
  • 1,399
  • 11
  • 20
2
votes
3 answers

How to fetch only phone number contacts from Android device

I am following this example retrieve list of contacts to retrieve contacts from android device. It gives all the contacts which includes email contacts and some empty contacts. I tried modifying ContactsContract like…
2
votes
1 answer

Adding a contact usefully with ContactsContract

I'm able to add a Contact with ContactsContract to one of the user's accounts (a difficult feat in itself!), but I still haven't been able to add it to a group that will show up. I know that the user can go to their contact options and check a "Show…
B_.
  • 2,164
  • 2
  • 17
  • 20
2
votes
1 answer

How to code ContactsContract so that it runs in 2.2 and doesn't crash 1.5?

I have the following piece of code in my Android application that looks up a contacts ID, I have just changed the target from 1.5 to 2.2 but with a min SDK of 3 (1.5) so that I can use the ContactsContract Uri in 2.2 and the People Uri in…
Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
2
votes
4 answers

New contacts created using ContactsContract do not appear in Contacts app

I'm using the following piece of codes to create a new contact. It follow closely the ContactManager example provided by Android. The problem is, the created contacts do not appear in the Contacts app that shipped with Android. Nevertheless, when I…
Paul Hoang
  • 1,014
  • 2
  • 11
  • 21
2
votes
1 answer

Adding a contact group gives NullPointerexception on HTC and Samsung devices

I'm trying to add a contacts group with a ContentProviderOperation. This works on Nexus, Moto G and Asus devices but it crashes on HTC M7, M8, M8 mini and M9, Samsung S4, S5. Because I only have the sources of the normal clean Android I can't find…