How can I apply a ringtone to only the selected contact?
I have found a way to set the default ringtone that applies to all contacts, but that is not my goal.
I want an application to have a button ("Apply ringtone to contact") that, when clicked, starts an
You can use ContactsContract.Contacts which has a column
CUSTOM_RINGTONE (which is a read/write column!) for this purpose.
Uri contactUri; ContentValues values = new ContentValues(); values.put(ContactsContract.Contacts.CUSTOM_RINGTONE, newRingtoneUri.toString()); context.getContentResolver().update(contactUri, values, where, args);
Furthermore, you may find this discussion useful (code taken from there).