I'm trying to get all the contacts that have more than one phone number. Using sqlite3, I queried the database like this:
select number,name,person,type
from view_v1_phones
where person in
(select person from view_v1_phones group by person having count(*)>1);
and got what I was looking for. However, I don't know how I can use this when I'm querying the database using contacts api (ContactsContract).
Help!
Here is a link I found when I was working on something similar. This one is a pretty comprehensive guide to contacts in android. It is a 6-page guide! Hope this helps:
http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/1/
Related
I'm developing a feature in my app to help users find friends who are registered and are in the contact list on the phone. Something like what instagram does here:
Does firebase have any way to synchronize and compare contacts? I think that comparing each phone contact with each database contact will not be very efficient in terms of performance.
Does firebase have any way to synchronize and compare contacts?
It does not. You should create your own system for that.
I think that comparing each phone contact with each database contact will not be very efficient in terms of performance.
Is not. In fact, is quite simple and efficient since Firebase SDK provides a method that can help you simply verify if a user exist or not in the database, this method is called exists().
For more informations, please also see my answer from this post.
I need google id of the contacts, Is there any way to find the google contact id for my address book contact?
I found this answer, which shows it is possible in Android.
How can I achieve in iOS??
Please help me to find google id from address book.
How about trying to visit this document.
If my understanding is right, you need this Unified Contacts.
Contacts in different accounts that represent the same person may be
automatically linked together. Linked contacts are displayed in macOS
and iOS apps as unified contacts. A unified contact is an in-memory,
temporary view of the set of linked contacts that are merged into one
contact.
You can also refer from these SO post 1 and SO post 2 for further details.
Try also the suggested code in this SO post.
I am working on an IM application in android. Now i created a separate table for maintaining the app contacts. In this case my contacts are difficult to manage when there is a change in contacts of android system. For avoiding this I found to use a Sync Adapter with ContactsContract provider. I referred the developer document for managing the contacts. I found how to create account, raw contact on an existing contact. Now what i need is how to have my columns(Presence[String],subscription status[integer], etc.) on ContactsContract.Data. I know I have to create my own DataKinds, but I don't know how to. So please give me some solutions to solve this. Thanks in advance.
finally I found how to keep status, presence details in ContactsContract.Data by this link...
I'm building a small app for messaging (in some way a bit similar to 'WhatsApp' or 'Viber'). WhatsApp and Viber show you contacts that are from your contact list and have an account with them. so my question is how to sync?
For now, I have database which stores all users using the application and their phone number.
Do I need to run a query for each contact in my phone in order to find it in the database?
It looks a lot of queries for every sync request.
What is the efficient way in order to do this?
If you have both sets of data as database tables, then can't you just join on some attribute like 'Full Name' and the resulting table will be all people in your contacts list with the app installed?
You can display contacts in your app that are just pulled from the contact list on the phone. Using LoadManager you can get a contact list that is synced with the phone list.
Check out these links for more info
http://developer.android.com/training/contacts-provider/retrieve-names.html
https://developer.android.com/training/load-data-background/setup-loader.html
My issue is quite simple I think :
I would like to be able to add a contact to the contact list by a simple click on a button (and be able to test it on the emulator). The data of this contact would be stored in the source code of the application.
is there an easy way of doing that?
thank you for your answers
The only easy way to insert a contact is to use an INSERT action, where you supply some of the data and start up an activity for the user to provide the rest and confirm adding it to the contacts list. Here is a sample project demonstrating this.