I want to make an option in my app that shows all contacts who are using this application. Its just comparable with the WhatsApp contact tab which is showing there names,status and picture.
I had the idea that I just upload the phonebook contacts with there phone number into my database and I would be able to match these contacts later.
Example :
If person "A" has the phone number of B in his phonebook(which is in the database) AND If person "B" has the number of "A" in the phonebook (which is also in Database) THEN match them and make them Visible as friends in the App.
I wanted to realize this through mysql. BUT now theres my problem :
What if the person A or B did not saved his friend with for example a area code or country code but the other did ? So they wouldn't be able to be matched in my database.
Is there a way to normalize the phone numbers before uploading them into my database ? That means that the app automatically adds there area code or location code ?
Related
In my android application I would like to display the mobile user's contacts (names, profile picture ) displaying first the contacts that have already installed and registrered that application (the matching is made by contact's email).
Trying to loop over each contact and match if their email is already registered (in an external SQLITE table) don't seems to be an efficient way.
I would like to directly add (somewhere in the address book ?) the extra data "isRegistered = true/false) and order my addreess book query by this value to scroll the address book.
Is it possible? How to implement this in detail ?
OPTION 1
I think the most efficient way would be what you thought about initially, with a slight improvement:
store the list of registered emails (for the user's contacts) in a local SQLite DB.
read the entire list of emails on application launch, and store them in a HashSet
When sorting the contacts, create a custom Comparator to first check if the contact is an app user or not, and only then fallback to name compare.
OPTION 2
If you still want to check the option of storing the custom value in the Contacts DB, and integrate it into your query, you need to create a SyncAdapter.
This is basically a service that is able to sync contacts to/from a server into your own RawContact, which is then aggregated into one-or-more existing RawContacts, like Google does for Google Contacts.
You can set it to be notified when a new contact is added, and have your SyncAdapter add the needed info to the contact so it'll show links to your app.
If you go to your phone settings > accounts, you can see Whatsapp and Google's SyncAdapters there, where you can turn them off/on.
To create a sync adapter, you can follow the official docs, or this great tutorial.
My app allows the user to white-list contacts. The user is allowed to make calls only to the white-listed contacts.
I have achieved this functionality by saving the white-listed contact information in a SQLite table and displaying them in an activity along with contact photo and name.
When the user clicks a contact, that contact card opens up and a call can be placed to the selected number.
I would like to get rid of the activity that displays the white listed contacts and use the standard contacts app instead.
The contacts app should display only those contacts that have been white listed by the user and hide the contacts that are not white-listed by the user.
How would I achieve this?
I am developing an Android chat messaging app using Parse where I am saving user's phone number, username, and password during the sign-up process that I have completed successfully.
Now, I want to fetch the list of users already saved under the Phone Contact list matching their phone numbers and display the users in a list view. I am stuck of writing the Parse query and showing the fetched users in a list view.
What you can do is the following:
Get all your contacts phone numbers into a list
In ParseQuery use the following method (from parse docs website)
Please make sure that your contacts list is not too large in order to avoid performance issues. If it's too large you can split it and execute 2 calls and then merge them on the client side.
if you need more info please let me know.
My app lets the user select a contact using the contact picker. Afterward lets user selects one or phone phone number to be stored for later use (the numbers are stored in the db)
The trivial solution would have been to save the selected numbers to the database as strings. However I would like to avoid duplicating parts of the the device's contacts list and keep a link (e.g. a URI to a particular number) to that contact.
so far was not able to find a way to do that, the documentation states that the contact id itself might change, So I can only assume it also true for the contacts phone number.
am I missing something ?
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