How to show my app icon in the Contacts Android app for user contacts that are registered?
You need to display your app icon in User's contact app if that number is register with your app .
So for that you need a SyncAdapter
.
For detail Information about how it works . Please visit this link.
If you need any demo you can check SyncAdapter Example
how to show app icon in android phone book like whats app skype
Well the icon simply says that your app is associated with this contact or in other words: it has also provided this contact information along with an action.
In order to get achieve this you will need to provide a sync adapter which provides your contacts and the extra information associated with it.
Developer info for sync adapter: http://developer.android.com/training/sync-adapters/creating-sync-adapter.html
Example for a contact sync provider (a bit old but the concept is still the same): http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/
How to show app icon when new contact added
Fetch all the contacts from your phone like this.
public void getNumber(ContentResolver cr)
{
mItems = new ArrayList<String>();
Cursor phones = cr.query(Phone.CONTENT_URI, null, null, null, Phone.DISPLAY_NAME + " ASC");
while (phones.moveToNext())
{
String name=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumberString = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
phoneNumberString.replace(" ", "");
contactName.add(name);
contactNumber.add(phoneNumberString);
mItems.add(name);
}
phones.close();
}
now send all these contacts to your server, compare each mobile number in your server database, and list only the contacts that are found in your server.
You need to maintain your own database, when registering user, save his number and while comparing, compare the fetched number to the register member's number in your own database
Related Topics
Get Meta Data of Image - Android
Android Fingerprint API for Time Attendance App
How to Reduce Latency in Mediacodec Video/Avc Decoding
Android: Support Multiple Screens
I'M Getting a Nullpointerexception When I Use Action_Image_Capture to Take a Picture
How to Read All The Coming Notifications in Android
Bypass Android's Hidden API Restrictions
Google Maps API V2 Class Not Found
How to Make Facebook's App New Menu on Android
How to Work-Around the Blank Title in Pagertitlestrip and Pagertabstrip
Call Recorder Not Working in Android 10 (Q)
Sqlitedatabase Close() Function Causing Nullpointerexception When Multiple Threads
CSS - Background-Size: Cover; Not Working in Firefox
A Pre-Populated Database Does Not Work at API 28 Throws "No Such Table" Exception
How to Style Appcompat-V7 Toolbar Like Theme.Appcompat.Light.Darkactionbar