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

fetch out all contact numbers plus alternative numbers

I wnat to fetch out all contacts numbers + alternative numbers. in first used this code: Cursor phones = _context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null, null); while (phones.moveToNext()) { …
saeid ezzati
  • 855
  • 11
  • 29
0
votes
1 answer

Android ContactsProvider: How to get name and phone number in one row for specific contact?

I want to retrieve a cursor where in one row contains both name and phone number. Is the way to do this pretty, without any loops? Uri uri = ContactsContract.Data.CONTENT_URI; getContentResolver().query(uri, new String[]…
0
votes
1 answer

Android set contact's photo with ContactsContract

I am looking for a way to programatically update a contact's photo with a given Bitmap image. I'm doing the following, but nothing happens. Neither is the picture being set nor occurs an error. Cursor cursor =…
n1try
  • 1,050
  • 14
  • 23
0
votes
1 answer

How to get the group in which contact belongs to?

Android contacts Display Name and Phone Number(s) in single database query? The above link gives the details to get the phone number and name in the contacts database. I also want the group to which the contact belongs to ? How to get this from…
Deepak Bhatia
  • 45
  • 1
  • 6
0
votes
1 answer

EditText empty after phone number query - Android

I have a button inside a Dialog box called addContact() that when clicked, it should open my Contacts in my Android phone, which it does, and then when I click on a contact, it is supposed to pull the phone number from that contact and put it in my…
Azurespot
  • 3,066
  • 3
  • 45
  • 73
0
votes
1 answer

android.view.InflateException Binary xml file line #11: error inflating class fragment

I could not find a solution with other errors like this on SO. I get this error: android.view.InflateException Binary xml file line #11: error inflating class fragment then see this in the caused by: Caused by: android.view.InflateException: Binary…
0
votes
1 answer

SQLite Exception error, using CursorLoader & ContactContracts

I am trying to populate a ListView (that is a fragment) into an activity that loads the Android phone contacts. And since I'm not familiar with the SQLite-style queries, I may have messed up the syntax because I got this error:…
0
votes
0 answers

What is label used for in "public static final CharSequence getTypeLabel (Resources res, int type, CharSequence label)"?

I am trying to load my contacts into a ListView. I had no idea where to start, so I searched the www and found some examples. One of them (https://github.com/codepath/android_guides/wiki/Loading-Contacts-with-Content-Providers) describes the…
Vic Torious
  • 1,757
  • 3
  • 21
  • 24
0
votes
1 answer

update phone contact thumbnail

Problem: I cannot update contact's thumbnail by picture taken from camera. Environment: emulator, api19 My code: String where = ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " =…
0
votes
1 answer

retrieve contacts Given_name, family_name, prefix and suffix from Android Contacts

Is there a way to retrieve contacts Given_name family_name, prefix and suffix ? using one query for all contacts. I found a lot of solutions that suggest querying table ContactsContract.Data.CONTENT_URI but they specify the ID of the contact that…
N Jay
  • 1,774
  • 1
  • 17
  • 36
0
votes
1 answer

Updating contact photo using CONTACT_ID

I have been stuck on this problem for days, hoping someone can help. I am trying to update a contacts photo with a specific image using the CONTACT_ID, but this doesn't appear to be working. Do I have to use RAW_CONTACT_ID in order to do this?…
0
votes
2 answers

Bug after sign apk

I made a Contact App using Batch Operation like below final public class BatchOperation { private final String TAG = "BatchOperation"; private final ContentResolver mResolver; // List for storing the batch mOperations private final…
Tai Tran
  • 1,406
  • 3
  • 15
  • 27
0
votes
1 answer

How to retrieve data from contact Uri of a list item obtained from onItemClick() in listview?

How do I obtain the contact details from a uri in a list view? . I have obtained the contact uri for the selected contact from the listview. The following snippet is a what I have attempted but does not work. What's even more surprising is that the…
0
votes
1 answer

android: Updating a contact using batch method

I'm using below code to updating a contact: Cursor cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, new String[] {Phone.NUMBER, ContactsContract.Data.CONTACT_ID}, null, null, null); …
Sirwan Afifi
  • 10,654
  • 14
  • 63
  • 110
0
votes
1 answer

Import vCard on android

I need to import multiple vCard files in android contacts, android contacts already have the feature of importing vCard files, what i need to do is to pass an Array contains paths to each vCard file and make the contacts app in android import them…