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
1
vote
0 answers

Android: NORMALIZED_NUMBER not showing emulator number and device number

While I am retrieving contacts from my device using ContactsContract.CommonDataKinds.Phone.NORMALIZED_NUMBER The list does not show emulator number saved in contact list and my own phone number as well. I tried saving it in different formats…
1
vote
1 answer

Display name not updating Email.Content_URI

I am trying to update Display name and email id of an existing contact, I am able to update email address, but display name not updating, the code I am using is here. I have tried plenty of more code but nothing is working for me please help.…
Mohd Mufiz
  • 2,236
  • 17
  • 28
1
vote
0 answers

Change of ContactsContract.RawContacts _ID after aggregation

According to Google docs, you should use LOOKUP_KEY to fetch a contact, since its ID in the ContactsContract.Contacts table can change: An opaque value that contains hints on how to find the contact if its row id changed as a result of a sync or…
Joel
  • 5,949
  • 12
  • 42
  • 58
1
vote
1 answer

Using Entity Uri to get Contact Infos on Sony Xperia SP

I'm developing an App dealing with Contacts and Calendar. I'm having a hard time with a specific device, the Sony Xperia SP, but I couldn't find anyone else having the same problem. I'm trying to get the Display Name, and Phone numbers of my…
tchoum
  • 312
  • 1
  • 2
  • 10
1
vote
3 answers

Cannot retrieve email from Contacts

I want to retrieve email,phone number and contact names from my phone-book and display them in list-view. The name and numbers are coming perfectly but the emails are not retrieving. Here is the relevant code: public void…
kgandroid
  • 5,507
  • 5
  • 39
  • 69
1
vote
0 answers

prevent duplicate entry in contact list

i want to enter contact list: "contact_name" , and "contact_number" into phone's contact list i used following code for that : ArrayList ops = new…
Nirav Mehta
  • 1,715
  • 4
  • 23
  • 42
1
vote
1 answer

set ContactsContract.CommonDataKinds.Im.CUSTOM_PROTOCOL to custom value

I call an intent to add a contact to device like this : Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE); …
Matej Špilár
  • 2,617
  • 3
  • 15
  • 28
1
vote
3 answers

Android: ContactsContract.Contacts.HAS_PHONE_NUMBER returns NULL

I am trying to use provider ContactsContract for retrieving contacts information. Before fetching the Phone Numbers of contacts, I am checking whether contacts have phone numbers. For that I am using uri ContactsContract.Contacts.HAS_PHONE_NUMBER…
Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46
1
vote
1 answer

how to save contacts names , numbers , contact_id to ArrayList / contact picker

This activity is working but i want to save contacts information (phone_number , name , contact_id) to a ArrayList . Then i will use a customadapter to listview this arraylist in checkbox for multiselecting construction . I will use contact…
1
vote
2 answers

read/parse only Mobile numbers from android's phonebook (ContactsContract.Contacts)

How to get all the real mobile numbers from androids phone book? I used ContactsContract.Contacts and created respective cursors. while it's working fine, I am stuckup with only fetching VALID MOBILE NUMBERS We can use…
Rinav
  • 2,527
  • 8
  • 33
  • 55
1
vote
1 answer

How to get unique contact number from my contact application in android?

I am making a contact application but when I get all contact numbers I get duplicate numbers. How can I make sure that I only get unique numbers? ContentResolver cr = getContentResolver(); Cursor cur =…
Najib.Nj
  • 3,706
  • 1
  • 25
  • 39
1
vote
1 answer

Open .vcf vCard file directly with contacts app

I'm trying to programmatically start the contacts app to import a big .vcf file with a lot of contacts. The following code works almost perfect. String vcfMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension("vcf"); Intent openVcfIntent =…
1
vote
0 answers

Why does adding contact with intent discard structured address?

Based on "Modifying Contacts Using Intents" (Android developer documentation) and the answer to "Start add new contact activity and pass structured data", I've devised a way of populating the Android contact picker with data to be edited and saved…
1
vote
1 answer

Get phone contacts without the photos in order to save them in a DataOutputStream(vcf format)

I have an application that export the phone contacts to the sdcard in a vcf format. I am able to get all the vcards and save them in a vcf format(looping on every ContactsContract.Contacts.LOOKUP_KEY until the cursor count -1 is reached in order to…
Nabz
  • 390
  • 2
  • 14
1
vote
1 answer

Adding a ContactsContract.CommonDataKinds.Event to Android contacts, does not show up

I'm trying to add a birthday event to contacts but the event doesn't show up when displaying the contact in the People app. When going into 'Edit' mode of the contact, an event DOES show up, but no selected date (see attached screenshot) as if the…
Alon Burg
  • 2,500
  • 2
  • 27
  • 32