1

I want to show my app icon in phone book next to each contact that is associated to my app like whats app, Skype.I have searched through Google but didn't find any valuable solution to my problem.Is there any sample code for this.

2 Answers2

1

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/

Carsten
  • 806
  • 5
  • 6
  • Thanks Mr. Carsten for this valuable link, I am using the same but problem is that I have to hard code the contact name I want to add in this, I have another class for adding a contact , I am unable to add a different contact each time.. – Sandeep Dhiman Jan 13 '15 at 13:19
-1

So found two useful links for implementing the same

Display the app icon if the contact is associated with the application in phone address book

Show my app icon infront off contact

I found solution given in second link better----

You have to add in your manifest some rules.

In that way, Android will be able to list your application as compatible with a specific action (here is call action)

I think it will be something like

<intent-filter>
     <action android:name="android.intent.action.CALL" />
     <category android:name="android.intent.category.DEFAULT" />
     <action android:name="android.intent.action.CALL_PRIVILEGED" />
     <data android:scheme="tel" />
 </intent-filter>

(add this in your activity node that will handle operations)

Community
  • 1
  • 1
coolswap11
  • 101
  • 1
  • 8