2009-12-22

[Android] No ringtones in Android emulator

It has no doubt that no ringtones is pre-installed in Android emulator. Many discussion threads in the net have addressed this problem and provided solutions to install phone ringtones. What's missing is that people don't say how do I install notification ringtones in emulator? The method provided by folks only works for phone-ringtones
  • Push an supported audio file into /sdcard.
  • Mark this audio as ringtone in Music Player application.
And you still see nothing in the list of notification ringtones.

There should be some way for Android system to install different ringtones into emulator like a real phone. After all, it's not a limiting issue like hardware.

Indeed. When I was analyzing the directory structure extracted from ROM, I saw audio files in /media are placed like this,
[josh@tp14]:/tmp/ROM/temp/media/audio > ll
total 16
drwxr-x---  2 josh staff 4096 Dec 22 12:15 alarms/
drwxr-x---  2 josh staff 4096 Dec 22 12:15 notifications/
drwxr-x---  2 josh staff 4096 Dec 22 12:15 ringtones/
drwxr-x---  2 josh staff 4096 Dec 22 12:15 ui/
[josh@tp14]:/tmp/ROM/temp/media/audio >
It's natural for me to think if I have my /sdcard directory to imitate this, can it work? Ok, let's try. I pushed several audio files into /sdcard/media/audio/notifications.
foreach f (*)
  adb push $f /sdcard/media/audio/notifications
end
And then have MediaScanner to scan /sdcard directory. Voila, it works.

 


The phone ringtones of course can be installed in the same way. :)