Search code examples
androidandroid-contactsringtone

Get custom ringtone path of contact Android


How can I retrieve the current custom ringtone path assigned to a contact with Android? Are they all stored in a special folder?

ContactsContract.Data.CUSTOM_RINGTONE

Thanks for your help.

EDIT: I need the actual sound file in a byte array or something similiar.


Solution

  • It is like a normal field. To get the path I had to do:

    int customRingtoneIndex = contactCursor.getColumnIndex(ContactsContract.Data.CUSTOM_RINGTONE);
    String customRingtone = contactCursor.getString(customRingtoneIndex);
    

    That returns the path to the actual content e.g. content://media/internal/audio/media/162