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
1 answer

Insert a new contact - why ContentValues is not working

Following is working for inserting a new contact: ArrayList ops = new ArrayList(); ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI) …
Deqing
  • 14,098
  • 15
  • 84
  • 131
1
vote
2 answers

Views contact details and get phone number selected by user

I want to display the native android contacts list and then once the user picks a contact, i would like to move to the next native screen where it shows the details of the contact (like phone numbers, email, etc). Now once the user selects either…
Sunny
  • 7,444
  • 22
  • 63
  • 104
1
vote
1 answer

How to handle different Birthday Formats? Skype returns Jan 1, 1970

I am querying the ContactsContract.Data.CONTENT_URI with the following arguments, in order to get all of the device contacts' birthdays final static Uri CONTENT_URI = ContactsContract.Data.CONTENT_URI; String SELECTION_ARGS =…
Alex Styl
  • 3,982
  • 2
  • 28
  • 47
1
vote
1 answer

Some issues when adding image to android contact

I am working on an android application. In my app I have to add details and image to Android contact. So I used the following code private void addcontact() { // TODO Auto-generated method stub …
1
vote
2 answers

When I select contact name and address from contact list address data not retrieved

I need to get contact name and relevant address from contact list in android. I get the contact name and their phone number, but unfortunately unable to get the address details. When I select the contact address, it will return null every time. I…
Ahamed Salik
  • 313
  • 2
  • 4
  • 18
1
vote
1 answer

How to delete a specific field in a contact?

I have an issue here, i am able to delete individual contacts fine, My concern is more regarding deleting specific fields (Mobile Number, WorkNumner) with in a contact. let me give you a example, Contact Data: Name : Jhon email :…
sunil
  • 177
  • 2
  • 12
1
vote
1 answer

Column Data 1 doesnt Exist.. Illegal Argument Exception

I have this customListView which shows all the contacts from a phone with a checkbox on each row for multiple selection. The problem is that i cannot display the phone number. Only the contact name comes up. The code is import…
user2511882
  • 9,022
  • 10
  • 51
  • 59
1
vote
0 answers

Writing contacts on an xml file in Android

Hello I have this code(pasted below) which reads and displays the phone contacts in a ListView. Apart from this it should also have one more functionality and that is it should be able to write the contacts as they are being read onto to a xml file.…
1
vote
2 answers

Reading Contacts in Android and writing them onto an XML file

Hello I would like a detailed explanation or an example of retrieving two details in the android contact list(name and Number). Once I receive these details I want to write them onto a XML file. As I need to send this XML file to a php server. I…
D'yer Mak'er
  • 1,632
  • 5
  • 24
  • 47
1
vote
2 answers

Android MultiAutoCompleteTextView to retrieve multiple contacts

I am trying to modify a code that I have seen on stackoverflow for an AutoCompleteTextView so that i would return mutliple contacts for a MultiAutoCompleteTextView. However, when I load this onto my Android phone I can no longer see any suggestions…
1
vote
2 answers

Displaying contacts with EMAIL address only in android

i am trying to build a app, where phone contacts only with email address has to be displayed to the user.When the user click on the editbox in my app,phone contacts only with email address has to be displayed,after the user selects a contact, the…
DevAndro
  • 205
  • 1
  • 6
  • 18
1
vote
1 answer

how to specify account for ContactsContract editor

From my app, I want to invoke the Contacts editor to allow the user to add a new contact. I want to find a way for the app to pass to the editor an account to be used. How can this be done? I have not found any documentation on how to do this. I…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
1
vote
2 answers

android contacts sync without auth token

Is there a way to sync android contacts with server without using authToken, just username and password? How can it be done? I want to authenticate with username and password everytime i sync the contacts, without using the authToken at all. Let's…
nikmin
  • 1,803
  • 3
  • 28
  • 46
1
vote
1 answer

android: Contacts provider working in emulator but not on phone

I'm building Contacts provider for android with sync adapter. For now, I have ArrayList of contacts that I'm adding. When I run it on the emulator It's working just fine, but when I run it on the phone (Samsung Galaxy S Plus, Sony Ericsson Xperia…
nikmin
  • 1,803
  • 3
  • 28
  • 46
1
vote
1 answer

Android 4.1+/ContactContract: Lookup group to given contactId (derived from lookup a number)

The following function has a phone number as input parameter (e.g. +436641234567 or +436641234567) and performs two lookups in the Contacts database: first, identify the user belonging to this number (this already works) and then to use the id of…
Markus Proske
  • 3,356
  • 3
  • 24
  • 32