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...
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 have a question regarding - how contacts are synced between your android app and server to retreive particular contacts just like whatsapp? Can anyone help me out here?
You basically need to add permission to read the device contacts and then you'll have access to them. There's a guide here: https://developer.android.com/training/contacts-provider/retrieve-names.html
since contact is a shared data. you have to to use content providers to update conact. Refer this http://developer.android.com/guide/topics/providers/content-provider-basics.html
I have a requirement like, I can be able to find the people who are using a particular app from my contacts. It is much similar like Whatsapp contacts syncing.
Whatsapp contacts is so fast & very accurate. What is the logic for it?
I'm not sure of their exact logic, but a way that I have seen it done before is as follows...
Access the phone's contacts (duh)
Get the contact that you want to add as a "friend" in your app.
Cross reference that contact's phone number with the user information that you have stored in your application's database
If that phone number exists in your database of users, then you've got a match and you can process things however you'd like from there.
That's one way of doing it, but I don't know if that's exactly how WhatsApp does it. Hope this helps!
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/
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.