0

i am looking for solution how to add my own notification sound to android device. Sounds should be visible in list showed by RightoneManager. Context of my app is that user can choose some notification sounds for some actions and i want to set default sound as my own sound. Iam using this code for calling RighToneManager.I searched for solution some time but unfortunately i didn't find anything relevant. Thanks.

Community
  • 1
  • 1
Matin Petrulak
  • 1,087
  • 15
  • 23

1 Answers1

1

On the SD card, in the root directory, create a folder named "Notifications". Put your custom notification sound (mine are encoded in .m4a, not sure what format is supported) in this folder and it should appear in the system wide notification sound picker.

You can do it programmatically using the java.io.File object to create the "Notifications" directory if it doesn't already exist and copy your sound into this directory

If you want to add your own ringtones, you can do the same thing, but this time, you will have to create a "Ringtones" folder.

Edit: It looks like the directory location may be different depending of the Android's version. You should consider using the following location for your custom sounds: /sdcard/system/media/audio/notifications

Greg K
  • 330
  • 2
  • 5