- Phone ringtones.
- Alarm ringtones.
- Notification ringtones.
- UI ringtones.
If you don't want to install RingsExtended, put your favorite songs into /sdcard/media/audio/alarms in your SD card. You will see them showing up on the built-in ringtone picker for you to select.
From a developer's perspective, another thing you need to take into account is the volume up/down buttons of your phone. You need to decide which audio stream is affected by volume up/down buttons in your application. In my case, OpenAlarm is an alarm application and whenever you click volume up/down buttons, only alarm volume should be affected.
The mistake I made was that I only change the volume of an internal MediaPlayer charged of playing ringtone. It's not enough. In Android, audio settings are controlled by AudioManager and concepts of audio streams are used to control volumes of sounds in different situations. In documentation, they are
- STREAM_ALARM
- STREAM_DTMF
- STREAM_MUSIC
- STREAM_NOTIFICATION
- STREAM_SYSTEM
- Have your activities aware of volume change by
setVolumeControlStream(AudioManager.STREAM_ALARM);
- Apply proper audio stream settings to your MediaPlayer.
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);