In the Android Contacts application, non-local contacts have a icon to indicate the source of the contact (e.g. Google contact, Skype contact). My application is showing all the contacts and I want to show the source using the same icon. However, I don't want to maintain my own set of icons. Is it possible to get this icon from the ContactProvider. I found the API that provided the contact a/c info but don't see the constant for icon. Is it possible to get this icon. If yes then how?
Thanks
I think the CONTACT_STATUS_ICON might be what you're looking for. Not 100% sure though.
Finally figured out the way to do this. Here are the steps:
Get Contact's ACCOUN_TYPE.
Add GET_ACCOUNTS permission in the manifest file.
Get the Account using AccountManager getAccountsByType. Note that this returns an array but we can assume that all of them have the same icon (for the same account type), so just fetch the first one.
Now get the icon for the account using the code from here
Related
I'm writing a custom Android contacts directory, I have implemented the ContactsContract.Directory provider and the search from within the phone app works fine.
The problem I am facing now is that when I have an incoming/outgoing call the Android dialer does not query the custom directory I registered. Is it possible to partake in caller ID resolution via PhoneLookup or some other way?
Also as a possible workaround I have tried implementing an outgoing/incoming call interceptor with BroadcastReceiver but I see no way of returning the contact data to the dialer. The only option I have found for displaying the data is to overlay a transparent activity over the native dialer. Is there a way to return contact data back to the dialer that sent the broadcast? Any other ideas I could try?
PS. Google uses the functionality I'm trying to implement for nearby places directory listings and Caller ID by Google.
PPS. By reading the ContactsContract implementation of PhoneLookup I stumbled upon corporate contacts directory that can be appended to the user profile's default directory, according to the code it should get queried for PhoneLookup, so I'm going to try that on Monday.
I want to display my app's icon in the contact info as a shortcut. The same way as google+, fb, whatsapp does.
I found this question: Display the app icon if the contact is associated with the application in phone address book
And its very similar to what I want to do, but using Apache Cordova. Any ideas how can i do it?
I tried adding my app deeplink in contacts IMS using the contacts plugin, but no success so far.
Maybe this will help a bit. Give it a try!
This module is on my to-do list but i've kept it aside for a while...
I'll post if i'm able to do it. Please do the same!
I'm currently writing an App which allows to extend the standart Android contacts / phonebook. The user can add some informations / content associated with a specific contact. I want the standart phonebook to show an link to my application on every contact which has additional data in my application. For example WhatsApp is able to do so. If somebody from you phonebook has an WhatsApp account the phonebook displays a small WhatsApp icon next to the contact. If you hit the icon WhatsApp starts automatically a chat with this specific person.
My question is now how this can be achieved ? If someone can point me in the right direction it would be great.
I guess it must be done somehow with an ContentProvider. I already specified an ContentProvider but I don't know how to tell the Contacts app that this one exist or where I need to register this provider.
You need to use Contacts Provider. Class ContactsContract.Contacts provide access to all the contacts available in android mobile.
You need to have Read contacts permission in your app manifest.
<uses-permission android:name="android.permission.READ_CONTACTS" />
Refer following Android developer site.
http://developer.android.com/training/contacts-provider/index.html
Source code can be downloaded at http://developer.android.com/shareables/training/ContactsList.zip
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 receive the user contact list from gmail using this (http://androidwarzone.blogspot.com.br/2011/07/android-oauth-full-example-with-source.html) tutorial. Everything worked just great, but I'm just receiving 24 contacts, nothing more, nothing less. If i delete an contact that is receiving and try to get the list again, ir brings me another contact placing the deleted spot.
How do I get the full list? There is a better way instead of this tutorial?
All contacts, including gmail, can be queried directly from the contacts content provider on the device.
http://developer.android.com/guide/topics/providers/contacts-provider.html#Access
In the tutorial what u have mentioned, in C.java file, for GET_CONTACTS_FROM_GOOGLE_REQUEST use this url https://www.google.com/m8/feeds/contacts/default/full?max-results=1000&alt=json
Here max-results=1000 means maximum 1000 results to retrieve per request