I've developed an application that creates users in the Phone's contact list using the contents of a Text file.
The problem is that all the extensions I've found that deal with contacts only allow new contacts to be added and not the modification of existing contacts.
For me with would be enough to have the possibility of clearing the contact list and then re-importing all the contacts again, but I wasn't able to find an extension that could do that either.
I took a look at the new functionalities and in order to update or delete a contact we need to know their rawcontactid...which we only get after we create a contact.
Is there any way to get this value for existing contacts?
There is a security issue here. If anyone could make an App that deleted the device's whole contact list, that could be used maliciously. Google are constantly tightening the security of Android to prevent that kind of thing.
If you are the owner of the device, you can use the tools that Android and/or the device manufacturer provides.
I understand that, but I'm trying to develop an application that completely manages the contacts. The goal of the application is to ensure that all the company's phone have the correct contact list, and not contacts randomly added by the users. That's why I need to delete everything prior to writing the new contact list.
...That's not a reason Google would go along with, but if the App is not distributed via Google Play Store, it could work - however in practise, Company Users often have good reason to add bonafide contacts, so deleting all contacts would most certainly be counter productive and you would swiftly become very unpopular
I think the best way to have a Company List of contacts would be to make a list specific to the App. No Android security breach and you could have a central list that all Users could update with their genuine new company contacts and all devices could, on notification, download the updated list. The security of those contact's details though needs to be, at a minimum, excellent, what ever you decide to do..
This is an internal network Chris. We can only call contacts inside our network, so there is no point in users creating their own Contacts.
The application I've developed allows users to make calls, but if the contacts are not in the phone's contact list, they can't see the name of the caller when they receive a call.
So that is a vote in favour of having a list dedicated to the App - you can ensure the Users can access the network's contacts and simply not provide any functionality for adding new contacts other than downloading an updated central list.