Hello.
Is it possible to edit a contacts custom ringtone preferably without any user interaction by using send broadcast or start activity? Thanks
Contact ringtone
Moderator: Martin
Re: Contact ringtone
Hi,
There's no easy way to my knowledge. You could probably update the contacts database with command content but this could become complicated.
You could also try to set the custom ringtone for a contact and replace the sound file when you want to play another ringtone.
Regards,
Martin
There's no easy way to my knowledge. You could probably update the contacts database with command content but this could become complicated.
You could also try to set the custom ringtone for a contact and replace the sound file when you want to play another ringtone.
Regards,
Martin
Re: Contact ringtone
Hi. Thanks for the response. I was already using the second method(replacing a file that I selected for that contact). I'm also doing something else now which works well:silencing the ringtone when a call comes in from some person and playing back a random song on the 'music' stream. It seems to start the play back sooner than if I let the ringtone play by itslef,don't know why that is.
I'm also interested in the 'content' method. Seems cleaner. Could you give me an example please?
I'm also interested in the 'content' method. Seems cleaner. Could you give me an example please?
Re: Contact ringtone
Hi,
Sorry, I have no good example for this. When you connect your device to a PC you can get a description of the command with adb shell content. It includes some examples for listing and modifying system settings.
Listing the contacts could look like this:
changing the ringtone of a specific contact could look like this:
The contacts content provider is quite complicated to work with. Here's the entry point to the documentation: http://developer.android.com/guide/topi ... vider.html
Regards,
Martin
Sorry, I have no good example for this. When you connect your device to a PC you can get a description of the command with adb shell content. It includes some examples for listing and modifying system settings.
Listing the contacts could look like this:
Code: Select all
content query --uri content://com.android.contacts/contacts --projection _id:display_name:custom_ringtone
Code: Select all
content update --uri content://com.android.contacts/contacts --bind custom_ringtone:s:content://media/internal/audio/media/123 --where "_id=321"
Regards,
Martin