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
0 answers

Add a specific key to a contact in android phonebook to easily identify it

I have a app which takes all the contacts from phone book and check them in my server to check if they are present or not. For which I normally take all the phone numbers each time and check for the sync. What I want to know if there is any key…
0
votes
2 answers

Decide if user chose or created contact

I my app a user can create or choose like this: Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE); …
Matej Špilár
  • 2,617
  • 3
  • 15
  • 28
0
votes
1 answer

Having a little difficulty getting more than one contact to show up in my app.

So, still working on the contacts portion of this code. I decided it was time to just show off my file. I am trying to select three contacts out of a contact list and make the name and number of said contacts show up on the screen. I manage to get…
CodeMonkeyAlx
  • 813
  • 4
  • 16
  • 32
0
votes
1 answer

Null Pointer Exception Within Edit Text relating to ContactsContract.PhoneLookup.DISPLAY_NAME

Alright I'm back once again trying to get some help with my contacts part of this app I am building. Basically I am trying to select a contact from the in system contact list. This part is done and working just fine. - Where I am having issue is…
CodeMonkeyAlx
  • 813
  • 4
  • 16
  • 32
0
votes
2 answers

how to get Contact Name for a given Phone number

This my Code I want get Contact Name for a given Contact number But Application forcibly closed . and I got Logcat Error below is Logcat I dont know where am making mistake. please help me how to get contact name for given Conact number. package…
user3562853
  • 21
  • 2
  • 9
0
votes
2 answers

How to get Phone Number from ContactsContract Android?

Can someone pls clarify how I can the phone number instead of checking if there is a phone number by ContactsContract.Contacts.HAS_PHONE_NUMBER. I tried ContractsContract.CommonKinds.Phone.NUMBER replacing has phone number but it continues to crash.…
user37375
  • 173
  • 1
  • 5
  • 22
0
votes
1 answer

How to retrieve a single contact

how can I retrieve a single contact and some associated data (e.g. emails, phonenumbers, addresses...) by its id/lookupkey? This is the code I use to add contacts (actually its from the internet and is working for me). // Asking the Contact provider…
Tim Joseph
  • 847
  • 2
  • 14
  • 28
0
votes
1 answer

Android: How to list all data rows belonging to a specific RawContacts account in one query

I'm creating a contact app in android and I'm adding contacts to a specific account. How can I select all Data rows for all RawContacts belonging to this account in one query? I know I can first select all RawContacts belonging to the account and…
sammygadd
  • 299
  • 2
  • 6
0
votes
0 answers

How to get the integer value of a string that represents a phone type

I have a string representation of a ContactsContract.CommonDataKinds.Phone.TYPE in android. I want the integer value of this type. e.g: lets say "Home" == 1 I had the "1" and then i used: ContactsContract.CommonDataKinds.Phone.getTypeLabel(...) to…
Daniel
  • 55
  • 2
  • 11
0
votes
1 answer

MultiAutoCompleteTextView with contacts phone numbers

I need to create a MultiAutoCompleteTextView with the phone numbers of the contacts on a user's device. What I need is similar to gmail; except with gmail email addresses are used. For the contacts, I have the following needs: each phone number…
0
votes
0 answers

Getting email address from contacts android

I'm trying to get email address from contacts. I read all the posts on Stackoverflow but did not found a solution. Here is code that i'm using public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode ==…
Alex Perevozchykov
  • 2,211
  • 22
  • 19
0
votes
2 answers

How can I receive a contact photo in my phone listener and pass it to my activity?

I am currently passing contact name and number with an intent. Which works fine. I am however unable to find out how I can pass a contacts photo and assign it to an ImageView in activity. I've searched around here and not found an easy answer to…
Carl
  • 249
  • 2
  • 5
  • 13
0
votes
1 answer

Android set contact photo good quality without pixilization

I'm developing app to provide and set pictures for contacts from social networks, and I'm already figure out how to set picture to contact, but when I do this programmatically picture is stored in lower quality. For example here is 2 examples, first…
Luft-on
  • 179
  • 1
  • 13
0
votes
0 answers

Few (specific everytime) contacts duplicated during insert in android

I am trying to insert a list of contacts in android using Contact API. But I am facing a strange problem with that. Some of the contact is getting duplicated if they exist in the phone book. But this happens to only a few of the contacts not to all…
Scorpion
  • 6,831
  • 16
  • 75
  • 123
0
votes
1 answer

Which one is better in _ID and LOOKUP_KEY and the reason

I want to search the contact list to get a particular contact using _ID or LOOKUP_KEY. Which one of these two is better and the reason. It will be really helpful if you give the main differences of both.
Venkat
  • 41
  • 7