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

No phonenr from ContactsContract

Im having some trouble with getting a phone number from a contact using the ContactsContract My code is protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { switch (requestCode) { …
Fredkr
  • 723
  • 3
  • 8
  • 21
0
votes
2 answers

on contact insert get Contact_ID

I am currently working on an app, where I need to insert contacts into the mobilephones contact list. Using the ContactsContract.RawContacts batch insertion, I successfully inserted contacts into the…
Max
  • 572
  • 2
  • 6
  • 23
0
votes
1 answer

Problems in adding data to ContactsContract.CommonDataKinds.StructuredName

I am trying to add Contact data in StructuredName with the following code. The problem is GIVEN_NAME is added but other fields are not added. ops.add(ContentProviderOperation .newInsert(ContactsContract.Data.CONTENT_URI) …
0
votes
1 answer

Aggregate Contacts are added automatically?

you must have seen this piece of code somewhere else too,but obviously there's no answer for this exception. EDIT: IF You've come here finding a solution to restoring contacts via vcardio.This is IT!! I got this while utilising the vCardIO api for…
Nezam
  • 4,122
  • 3
  • 32
  • 49
0
votes
1 answer

Android: contentResolver error when use query

I have a small app, just user choose one contact in the contact list and its Mobile phone number will print to screen. So, after a use click to one contact in list, it will return an URI object contain information about this user. And I put some…
hqt
  • 29,632
  • 51
  • 171
  • 250
0
votes
2 answers

How to update all the fields using ContactsContract

I have a question. In my application, the end user will enter uername, email and city. Now if the email entered by the user exists, then the update query should run. And the field username and the city should get updated in his cell phone. And if…
android developer
  • 1,253
  • 2
  • 13
  • 43
0
votes
2 answers

Contacts contentProvider is returning an empty cursor

I want to display the phone numbers of the contacts. If I run my code in the emulator nothing happens, but when i run it in my SmartPhone I found this error in the logcat ----> android.database.CursorIndexOutOfBoundsException: Index 0 requested,…
Wael Ilahi
  • 41
  • 3
0
votes
1 answer

displaying Contact and Phone numbers in a check box

I tried this code to display the phone numbers in a checkbox within a listView: @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); …
Wael Ilahi
  • 41
  • 3
0
votes
1 answer

displaying Contact and Phone numbers in a check box

I want to display the contact name and it's phone number in a check box in this manner: "ContactName : Phone number" But I find this error in the logcat "java.lang.IllegalArgumentException: Invalid column data1" Here is the code I work with…
Wael Ilahi
  • 41
  • 3
0
votes
1 answer

Contact's ID from number

I can find the number of the contact from her id. The following snippet prints a number on the screen. Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, …
yildirimyigit
  • 3,013
  • 4
  • 25
  • 35
0
votes
2 answers

Display Name and Phone Number(s) in check boxes

I'm trying to obtain a list of contacts from the native database with their Display Name and Phone Number and display each one in a check Box but it doesn't work with me Here is the query I've been working on LinearLayout ll; CheckBox ch1; String…
Wael Ilahi
  • 41
  • 3
0
votes
2 answers

Update raw contact in Android when you have only the contact id

In Android, when the user selects one contact using the contact picker, you get only the CONTACT_ID field. But for updating some contact info, you need to edit the raw contact data. To do so, you have to know the RAW_CONTACT_ID. Is this correct so…
caw
  • 30,999
  • 61
  • 181
  • 291
0
votes
2 answers

contact ID value in android

I am new to android development. I am developing a phonebook app. What I am doing is, trying to populate the phonebook with the contacts. Each contact has name, number and the emailId. Since each of the three is in a separate database, I am reading…
rahul
  • 6,447
  • 3
  • 31
  • 42
0
votes
3 answers

Add event for contact into Android's contact table

I've worked hard on the following code, but unfortunately, the entry is assigned to the wrong contact. I don't know why. Tested for hours days but can't find the mistake. Can you help me? I would like to use the code in order to select a person from…
caw
  • 30,999
  • 61
  • 181
  • 291
0
votes
1 answer

Can get ID from received phone number, but not group

I have succeded in getting the ID and name from a phone number that is calling in. What I would like to to is to see which groups this ID belongs to. I have tried the following: //Search for the information about the phone number, save the…