I have a list of contact numbers and would like to get contact records of all the contacts that match the phone numbers. i have only seen queries for finding a single contact based on a single phone number search using PhoneLookup. Thanks in advance
Related
I had to fetch contact list from android using contact provider, but it was showing me duplicate entries. So, How can I filter those duplicate entries.
For example, ABCD - 123467890, 1234567890, 1234567890
how to filter duplicate phone number using contact Provider?
And Can I fetch only phone memory contact list?
It is obvious to get duplicate contacts when you fetch them. Since, same contact (same number, different name or different number, same name) might be stored in either in google contacts, phone contacts or in sim contacts.
In order to eliminate duplicates in your application, use local database (SQLite provided by android) and make phone number as unique, no duplicates will be stored.
For more information refer this post How to get all android contacts but without those which are on SIM
Following Dalma Racz comment, will also lead you to the solution.
I have an application that stores the Contact_ID of contacts. I managed to retrieve the contact_id-s from the phone's Contacts. In some cases I want to make it possible to the user to either call or send a message to the given person behind that contact_id. I don't want to store phone numbers if possible.
So I have a contact_id and I'm wondering whether it is possible to display the list of the contacts with the name behind my contact_id preselected ?
cheers
I have inserted few contacts in through the android emulator.
I wanted to fetch the names, number,emails,etc. for each contact.
I understood that for fetching contact number we need to refer to
ContactsContract.CommonDataKinds.Phone.CONTENT_URI
instead of
ContactsContract.Contacts.CONTENT_URI
My question is how do i link both the query results so that i can aggregate a single contact and its attributes together ? It seems that only ContactsContract.Data.DISPLAY_NAME is common in both the results and the only attribute which can fetched in both the URI's without specifying in the query's projection.
Can anyone guide me ?
Thanks,
Adithya.
try these links:
How to call Android contacts list?
How to get contacts from native phonebook in android
How to obtain all details of a contact in Android
How to get the first name and last name from Android contacts?
How to import contacts from phonebook to our application
Android contacts extraction
How to get all android contacts but without those which are on SIM
Use select from ContactsContract.Data.CONTENT_URI and group results by LOOKUP_KEY. You'll receive a single cursor with phones, emails, etc., grouped by contact.
In onactivityresult we r getting cursor to the contact database to access various fields of contact database we have ContactsContract.PhoneLookup through which we can get index various db columns and then acccess them.
i am using contacts contract to take the phone number and name from the phone contacts... how can i take the value(the name and number) of a particular contacts into a variable.....i tried a lot but i was only able to display "DISPLAY_NAME and DATA_1".....
You can take a look at the tutorial at http://www.app-solut.com/blog/2011/03/working-with-the-contactscontract-to-query-contacts-in-android/ which covers how to query all contacts and basic information like the name or phone number for these contacts.
I need to find contact which saved in my Android phone, But save numbers are repeated in SIM and Google contact, Then That are returning before return Phone contact.
Is there any way to query phone contacts only?
Thank You.
use ContactsContract.Contacts class. it will give you all data for contacts only.