I\'m currently working on an application, where we are going to be adding contacts from our own application, similar to how LinkedIn has connections and Facebook has friends. Th
After having studied Budius' suggestions, I finally figured out how to do it. Here is a more precise link to the place where it's stated in the documentation. Basically you just need to make your account visible. Other than that, I found the answer on how to do that here.
ContentProviderClient client = getContentResolver().acquireContentProviderClient(ContactsContract.AUTHORITY_URI);
ContentValues values = new ContentValues();
values.put(ContactsContract.Groups.ACCOUNT_NAME, account.name);
values.put(Groups.ACCOUNT_TYPE, account.type);
values.put(Settings.UNGROUPED_VISIBLE, true);
try
{
client.insert(Settings.CONTENT_URI.buildUpon().appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true").build(), values);
}
catch (RemoteException e)
{
e.printStackTrace();
}
All credit for this code goes to Henry Pushel.