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

How to search Contacts with address (FORMATTED_ADDRESS) with one query?

I try to implement a live search over the users contacts, and I want to get the name, thumbnail and address (if there is one) of each matching contact. The live search is running while the user is typing. So he types ma and will get 'martin',…
longi
  • 11,104
  • 10
  • 55
  • 89
7
votes
1 answer

Get Android contacts with type-to-filter functionality, restricted to a specific account

I'm trying to: Display a list of contacts Let the user search through them by typing a query Limit search results only to a specific Google/Gmail account. This is how I build the URI for the cursor: // User is searching for 'jo' String query =…
7
votes
1 answer

How to secure my application contacts like Facebook

When you try to retrieve contacts from device , you generally get contacts created by all applications except Facebook. This question describes it. So , what would I need to do when I'm storing contacts through my applications(using…
Tushar
  • 1,607
  • 1
  • 16
  • 27
7
votes
2 answers

ContentObserver for contact update manually

I have registered a ContentObserver from service and I get the onchange() function when there is update in phone like call or contact update. But I want the onchange() function to be called only when add, update or delete happens. But I don't want…
Nency
  • 482
  • 1
  • 8
  • 21
6
votes
2 answers

Receive contact changes (added, deleted and changed)

Isn't there a timestamp for each contact? I need to be notified by a change (add, delele or change) to a contact. I've implemented a ContentObserver, but trough this method I'm only able to be notified if a change occurs on a contact, but I don't…
6
votes
1 answer

How to show custom type contact inside Contact like WhatsApp android

/** * Account type id */ public static final String ACCOUNT_TYPE = "com.test.app"; /** * Account name */ public static final String ACCOUNT_NAME = "Test"; public static void addContact(Context context, User contact)…
Scorpion
  • 6,831
  • 16
  • 75
  • 123
6
votes
1 answer

How to get all contacts first name, last name, email, phone number, etc without duplicates

I am trying to get details of all the contacts available in phone contacts using below code. But facing small issue of duplicate values. EDITED ACTUAL CODE STARTS :- private String refreshData() { String emaildata = ""; try { …
6
votes
0 answers

How to get notifications of changes in contacts even when the application is closed

My app "syncs" all the contacts on a phone with the server. However, part of the requirement is that if any contact is inserted, updated, or deleted then the sync must happen again to maintain data integrity. I know about registering a…
6
votes
2 answers

Get E 164 format of contacts in Android API less than 16

I retrieve the list of contact numbers from the phone using the following code: Cursor c = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null); while(c.moveToNext()){ Log.d(TAG,"NO.: "+…
geekoraul
  • 2,623
  • 2
  • 21
  • 33
6
votes
1 answer

How to beam a contact from you app (using NFC) and save it in contact list on receiving device?

How would you beam a contact using your own app (and using Android Beam) to another device and have it saved in their contact list (i.e. the default contacts app). The contact on the sending device will be provided by the ContactsContract…
Dennis
  • 56,821
  • 26
  • 143
  • 139
6
votes
2 answers

Difference between android terms?

I just stuck with one question , what is difference between "ContactsContract.CommonDataKinds.Phone.CONTENT_URI" and "ContactsContract.Contacts.CONTENT_URI"?
lakhani
  • 128
  • 2
  • 13
5
votes
5 answers

Getting Number from Contacts Picker

I am trying to get a contacts name and phone number after a user has picked a contact from the Contact Picker. I am attempting to make my application work for SDK v3 and up so I created an abstract class that would call only the API that I needed. I…
user543010
  • 273
  • 1
  • 3
  • 6
5
votes
3 answers

How to get the facebook id from a user through the ContactsContracts API?

I synced my address book with facebook and can now access my facebook profile through my addressbook. I want to read the facebook data that is connected to the account from another application and get the facebook id of the synced user. I can't…
Janusz
  • 187,060
  • 113
  • 301
  • 369
5
votes
3 answers

Why are some contacts censored from apps on android?

If you try the Contact Manager that comes with Android 2.2 Froyo it will give you access to all contacts in the sqlite database via Contact ContentProvider. But if you write an app that is not com.android.contacts you only get access to the…
radiofrequency
  • 873
  • 8
  • 19
5
votes
2 answers

How to only update contacts instead adding in sync adapter

I have few numbers stored in my apps database. I wanted to match those numbers in contacts app and update that contact with mimetype. Basically how Whatsapp does. They sync all contacts and their app icon comes in contact. I have done sync part and…
1 2
3
36 37