0

In the application I am building I am accessing the contacts of the mobile, but I need to know whether those contacts are editable (like the ones of the google account) or not (like the ones coming from Skype). I haven't found anything related to this topic anywhere, but I see that the contacts application from Samsung is able to distinguish between them, so it has to be possible. Any help or guide would be very appreciated. Thanks a lot!!

Well, it seems that maybe what I am asking is not completely clear. This is my specific use case: I am building an app that has a map. From it you can access the contact list and when you select a contact, this will be shown in a balloon on the map. If that contact is writeable, you will have a button in that bubble to edit that contact. But if that contact is not writeable, that button will not appear.

  • Hey, there were many discussion went through on this topic. Please go through following links. [here](http://stackoverflow.com/questions/8490123/how-to-update-existing-contact), [here](http://stackoverflow.com/questions/8788053/modifying-contact-information) and [here](http://stackoverflow.com/questions/16887240/edit-name-phone-number-of-contact-programmatically) – Karthik Kumar Feb 08 '16 at 10:44
  • Thanks, but none of those discussions make reference to the problem I am asking for (to know whether a contact is writeable or not). – NeoDemocrito Feb 08 '16 at 11:01

1 Answers1

0

You need to have following permissions which will enable write/read authority on contacts. When you have write permission, it implicitly means that you have edit permission on contacts.

<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_CONTACTS"></uses-permission>

For complete list of available permissions, please go through developer reference

To edit contacts please refer the this discussion.

For sample code please go through this and this.

Community
  • 1
  • 1
Karthik Kumar
  • 1,375
  • 1
  • 12
  • 29
  • Thanks again, but that is not exactly what I need. Maybe I didn't explain myself properly. In the contact list on your mobile there are some that you can't edit (like the ones coming from Skype) and that is ok, it is the way it should be (and it is the way it works manually or programmatically). What I need is that when I get the information of a contact, know whether it is writeable or not, because depending on that, I will perform different actions. – NeoDemocrito Feb 08 '16 at 11:57
  • I am sorry for that, let me think. – Karthik Kumar Feb 08 '16 at 12:08
  • Please describe actual use case, so that we may suggest appropriate solution. elaborate your question and be specific. – Karthik Kumar Feb 08 '16 at 12:09
  • Well, basically, I am building an app that has a map. From it you can access the contact list and when you select a contact, this will be shown in a balloon on the map. If that contact is writeable, you will have a button in that bubble to edit that contact. But if that contact is not writeable, that button will not appear. – NeoDemocrito Feb 08 '16 at 12:29