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

What is the FK for ContactsContract GroupMembership to Groups

For a row in ContactsContract.GroupMembership, how do I find the corresponding row in ContactsContract.Groups? GroupMembership seems to have only to "key" columns: GROUP_ROW_ID, GROUP_SOURCE_ID. The former has values like 14, 15, 16. The latter is…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
0
votes
2 answers

_ID column in Contacts database

I read that the different entries in different tables are linked via the _ID column in that table. For example a contact might have an _ID = 1 I get via ContactsContract.Contacts._ID and now I want to read the phone number of that contact using…
AndyAndroid
  • 4,039
  • 14
  • 44
  • 71
0
votes
1 answer

Insert a custom ringtone in a rawcontact (new contact)

I would like to add a custom ringtone in a rawcontact (before create the contact). I used this code with succes to add a custom ringtone in a contact (already created): String select = ContactsContract.Contacts._ID + "=?"; String[] args = new…
0
votes
1 answer

What kind of information can i find on android's Contacts Provider

I am developing an android application and I need to know all the information about phone contacts. I developed a function to get the name and number of all the contacts, but I need all the information about particular contact such as email, date,…
Terai
  • 311
  • 1
  • 4
  • 13
0
votes
1 answer

why won't contacts aggregate?

My app allows editing contacts. In this scenario, I chose a contact which existed in only one account and changed it to associate it with three accounts. However, I ended up with two contacts, not one, as shown in the ContactsContract dump below.…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
0
votes
1 answer

Email Not showing from Android AddressBok

I am working on have been getting contacts from the device's address book. I have an issue with getting the Email. I have tried and it keeps showing either phone number or a number (I am guessing it is a type). Please Help. Here is my…
0
votes
1 answer

How many queries are required to get the names and numbers of everyone in an Android contact group?

Using the Android 2.0 ContactsContract API, is it possible to build a list of objects representing contacts in a Contact Group like this: public class GroupContact { public String displayName; public List phoneNumbers; } While…
0
votes
2 answers

Remove custom account ACCOUNT_TYPE from contacts

I have created a custom account and i have added few contacts to that account. So now i want to remove the account from those contacts. I'm Googling since few weeks but i'm not able to find anything. If anyone knows how to do then please help me…
0
votes
1 answer

How can I make this ContactsContract.Contact query faster with CommonDataKinds.Phone inner query?

I'm iterating through Contacts table and each iteration do iteration on Phone table so it takes appx. 4 seconds to do contact list for 243 contacts (without iterating phone numbers it loads instantly). I'm sure there is a way to make it…
0
votes
1 answer

Access email-id along with name and phone number from contact list in Android

Here I am accessing name and phone number from mobile and uploading to server. I am not facing any problem in this. I have made some modifications to access email also. But I am not able to fetch the email. In place of email it is displaying phone…
0
votes
0 answers

How to get contact name and number from google account and display into ListView

I am creating an android app. In which i am creating one ListView in that ListView i am displaying contact from contact list and it is working perfect. But whenever i am run my application with other devices my app is crash. The problem is that on…
0
votes
1 answer

getting contact name using phone number not working

I am using below code for getting incoming call number which works fine. String number = intent.getExtras().getString(TelephonyManager.EXTRA_INCOMING_NUMBER); In next step, I tried to get contatc name using method getContactName(mContext,number): …
Mr. Nobody
  • 327
  • 2
  • 8
  • 21
0
votes
1 answer

Android - contacts address field updating to other fields

I am trying to update the native contact data through my app. The problem is when I am updating with address, the address is updating to First name and notes and phone fields. below code is I used in my app, please correct me if any mistake. public…
android
  • 43
  • 8
0
votes
0 answers

getContentResolver returning null for ContactsContract.Contacts

Calling an Activity from Main Activity , the Activity call CONTENT_URI through Intent Intent intent=new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, PICK_CONTACT); OnActivityResult i am…
0
votes
1 answer

Detect deletion of all contacts in android

If User is clearing data of native contact storage app from setting then how can I detect that thing in my android application? Is there any intent that is sent?