Display the App Icon If the Contact Is Associated with the Application in Phone Address Book

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



Leave a reply



Submit