Ringtone to contact ?

SoyEli

Active Member
Licensed User
Longtime User
Hello:

Can someone help?
is it possible to programmatically set a ringtone to a contacts ?

Thank you for the HELP
 

SoyEli

Active Member
Licensed User
Longtime User
I'm trying to set a X ringtone for all my contacts and have Y ringtone "default" for other incoming calls - with code

Can anybody help? I know I need to use ringtone manager, but a little help please...

Thank you:
 
Last edited:
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
With ringtonemanager I can only load default, and I think that's played with mediaplayer only, what about the other ringtones?
 
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
Thank you for the tip:
How do I use "http://developer.android.com/reference/android/provider/ContactsContract.ContactOptionsColumns.html#CUSTOM_RINGTONE"
to set the ringtone ?
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
It is not simple. You will need a library (or some steep reflection).
There are multiple steps involved:

1. Use Contacts Provider to get the contact_id of the Contact you want.
2. Use the Contacts Provider to fetch extra information about the contact especially Custom Ringtone field. This will return a URI of the custom ringtone.
3. Use Ringtone manager to pick a new ringtone, which will give you the URI.
4. Set the new ringtone back to the contact_id you found initially.

You can only do step 3 in B4A. You will need a library for step 1,2 and 4.

It is also possible to do with intents, but that requires a lot of experimentation IMO.
 
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
With Ringtone manager you can set the default ringtone, but the media player plays the ringtone ? it does't make sense, because when the phone rings media player is silenced so if using a Bluetooth YOU GET NO RING.

Any Ideas on this ?

Thank you:
 
Last edited:
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
Hello:

Is there a way to set a REAL ringtone for a contact, without using media-player?
if media-player is used, it will not ring with the Bluetooth connected.

Any other way?

Thank you for any HELP
 
Upvote 0
Top