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

Android Contacts Query Gets Duplicates

I'm trying to get all of the phone numbers for a contact. When I query the numbers associated with a contact with a cursor, I get duplicates of every number. After snooping around I believe that this is because of the Linked Profiles (i.e. Google…
Andrew
  • 1
0
votes
1 answer

Android: Accessing and querying properly using Raw Contact Id

So my app is attempting to integrate a sync adapter to the android native contact manager. This is all running smoothly except once a contact is synced, I am unable to update it. Details on this particular problem can be found here: Android: Content…
JMRboosties
  • 15,500
  • 20
  • 76
  • 116
0
votes
1 answer

AccountManager. Account type for contacts

Ok, so I have "fully" functional Account application. Except 1 thing. My application takes data from SQlite DB and create accounts through ContactContract with Account name and type specified…
DuhVir
  • 447
  • 1
  • 4
  • 15
0
votes
0 answers

Read contacts and display it in a recyclerview in Kotlin

I am trying to read contacts from ContactsContract in Kotin. But it's not showing any of the contact in the recyclerview. The noticeable thing is that the java version of this code is working fine. So, I here is my Kotlin code for reading the…
0
votes
1 answer

can't retrieve user profile

I want to retrieve a user's profile and it's image, but this is not working. I always get an empty cursor (cursor.getCount() == 0). Can someone help? I have a profile with an image and a phone number on my phone but I can't read it. Permissions…
prom85
  • 16,896
  • 17
  • 122
  • 242
0
votes
1 answer

Why do contact IDs not match between PhoneLookup and the ContactsContract.Contacts picker?

My app is scanning through SMS messages and calculating metrics, which it then stores in a database keyed by the contact ID associated with the phone number on the SMS. This first contact ID is looked up using the PhoneLookup mechanism. At a later…
Josh Hansen
  • 917
  • 1
  • 9
  • 20
0
votes
0 answers

how can i set custom_ringtone while adding new contact?

i am able to insert other contact informations like emails and phone numbers and all that but this setting custom ringtone for contact seems typical can anybody provide way to insert this? i am following this method to insert other…
Dhruv
  • 1,129
  • 2
  • 13
  • 32
0
votes
2 answers

Adding photo tumbnail to existing Android contact without photo

I've created a contact in the Android address book programmatically, which has a name and phone number. Now I'd like to add a photo to this contact, but I can't seem to get this working. I don't receive an error message, but the photo doesn't seem…
P Kuijpers
  • 1,593
  • 15
  • 27
0
votes
2 answers

ContactsContract.Data.IS_READ_ONLY returns negative value -1

IS_READ_ONLY flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter. See CALLER_IS_SYNCADAPTER. Type: INTEGER Constant Value: "is_read_only" When I have apply the above in my code, I am getting -1 as the output…
0
votes
0 answers

Android Contacts update creating duplicate record instead of updating records

I am trying to simply update various fields of a contact from my application. The result from my code is that instead of updating the records, another record is added and joined to the contact. My code is below. Any observable reasons as to why this…
NVA
  • 1,662
  • 5
  • 17
  • 24
0
votes
2 answers

How to get the phone contacts in a hashmap and store it locally and use it anywhere in the project?

I am trying to get the phone contacts and store it in a Hashmap. I want to save that locally and use it anywhere in the project. Following is my code to get phone contacts: public HashMap getPhoneContacts() { ArrayList contactList=null; …
neab
  • 91
  • 1
  • 3
  • 10
0
votes
0 answers

ContactContracts get Contacts GroupBy Name Using CursorLoader

I am retrieving list of contacts using cursorloader but due to the nature of the loader the parameters do not allow for groupby or set distinct. In my content provider I am able to use setDistinct or groupby in my querybuilder.query functions.…
NVA
  • 1,662
  • 5
  • 17
  • 24
0
votes
1 answer

Contact Picker Result

I'm using the ContactPicker for my app. I'm using this this tutorial to build my onActivityResult method. I can't get the content revolver to build; Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); Doesn't…
0
votes
1 answer

sql android ignore duplicate retrieving content

help me to fix this problem to remove duplicate contact that i get from Database cursor= getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null, ContactsContract.Data.MIMETYPE + "='" +…
0
votes
1 answer

Copy contact photo to my folder

I get contact photo URI Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.valueOf(contactID)); And I can now show this photo with Picaso: Picasso.with(mainUserPhoto.getContext()) .load(uri) …
ip696
  • 6,574
  • 12
  • 65
  • 128