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

Getting the email column index when choosing a contact java android

I am currently selecting a contact from the phones contact book, and then saving the name with the following code: int nameColumn = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); String name =…
user7884989
0
votes
1 answer

Is it possible have something like the GROUP BY clause in an Android managedQuery?

I'm planning to support Android devices from 2.0 onwards so I am using a managedQuery to query contacts. I get multiple results for people with the same name and phone number so I would like those results to be grouped. (That is I want each name…
Mel
  • 6,214
  • 10
  • 54
  • 71
0
votes
1 answer

Need permission to access contacts to save contact information from app to native contacts?

This question is regarding permission requests. I want to know whether it's necessary to request permission to access contacts in order to offer the functionality of allowing users to download a contact from an app and save it to their native…
maria250
  • 1
  • 2
0
votes
1 answer

Fetch contacts ignoring accents

I fetch contacts from the phone as below. I would like to ignore accent for exemple the name "Jérome" would be return either for search "jero" or "jéro". var contacts = listOf() val displayNameProjection =…
Nicolas
  • 663
  • 6
  • 17
0
votes
2 answers

Showing some contacts multiple times in my App from phone book

I'm getting same contact three or two times in my app this happening with some contacts not with every contacts. In my app everything is working as expected but when clicking on show contact from my it's shows three time same contact but in mobile…
Intellij P
  • 31
  • 9
0
votes
1 answer

how to implement search contacts using number in ContactsContract query. Like "display_name LIKE ?" for name

I want to implement search the contacts on basis of number provided. I have used ContactsContract to read all the contacts. I have implemented search criteria on basis of name by proving a searchView and the matching name will be displayed but I…
0
votes
1 answer

Contacts group GROUP_VISIBLE and GROUP_IS_READ_ONLY ignored?

Can someone explain me why this parameters GROUP_IS_READ_ONLY (set to 0) and GROUP_VISIBLE (set to false) are ignored when my group is created? I can still see group and contacts in it and also I can delete/modify my group and contacts in…
patonjo
  • 440
  • 4
  • 13
0
votes
1 answer

Too much time taken to save a contact

I saving a around 250 contacts in phonebook. And each contact is taking around 1 second to save in contact list. In my app, I might have to save more than 10,000 contacts. Then it will take hours to save them. So, I want a method to quickly save all…
0
votes
1 answer

When returning from contacts pick activity, the app closes without exception

In my Android application, when I pick a contact from the Contacts activity, instead of returning to the activity that called it, the application closes without any exception or error message. I tried to launch this activity with different flags,…
caesar-84
  • 35
  • 6
0
votes
1 answer

contacts are not loading into my list view android

I am trying to load the contacts in my phone into list view of an android app, but it doesn't loading my contacts. I got a dailog box to allow or deny permissions, when i pressed allow, its showing me a blank screen I used contact fetcher class to…
0
votes
2 answers

Get some contact info data from phone

I need to get list of id, first name, last name, number(or numbers), email, website of an android device contacts. I know by getting id I can query about phone numbers this is not a big deal. But I don't know how I should make query to get all these…
0
votes
1 answer

Associate data to android contacts

I am looking for a way to associate some data to all the contacts of the phone, and thus I have been trying to deal with the ContactsContract.RawContacts.Data Class but I couldn't get something to work. More over, I thought I could use the LookupKey…
olamotte
  • 917
  • 9
  • 20
0
votes
2 answers

Android adding contact to favorites programmatically - starred column does not exists

I've been trying to add some contacts to favorites programmatically and this is done by update the STARRED value from 0 to 1 of that particular contact but whenever i execute the query it throws an SQLite exception letting my know that the STARRED…
Eri Otero
  • 3
  • 4
0
votes
1 answer

notifying my app when a contact is added/deleted/edited through contentobserver

I am creating an android application and within my app there is a module dealing with contact synchronization in which i sync contacts from user contact. List with server contact list to filter users who are registered in the app, similar to…
0
votes
1 answer

Reading contacts on Android 2.2

I'm using the following code to read phone contact names and numbers on Android 2.2. What i want to do is go reading each contact name and number and append that to a Stringbuilder. Presently I'm able to get the contact name, but there's some…