Skip to main content

How do I change the Android SMS tone despite of current SMS tone setting?



I have developed an Android application for changing ringtones. It works quite well, but one thing bothers me.





When I set a ringtone as a notification tone, it plays when I receive an SMS message. However, if I have chosen a custom SMS tone earlier (ie. anything else than "Default ringtone" which is active by default) in the SMS settings, the new notification tone will not play when I receive an SMS.





This might lead to a situation in which someone installs the ringtone app from the Android market, sets the notification tone and gets disappointed because the chosen notification will not play when (s)he receives an SMS. The solution is quite easy (SMS -> Settings -> Select ringtone -> Default ringtone), but it's truly a nuisance if (s)he doesn't know this.





This is what I use to set the notification tone:







values.put(MediaStore.Audio.Media.IS_RINGTONE, true);

values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);

values.put(MediaStore.Audio.Media.IS_ALARM, true);







.....







RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_NOTIFICATION, persistentUri);




Comments

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.