Question

I have made an app that you puss a button and hear a ringtone!How can i add an option to save it to your device as a ringtone,if you like?thanks

Was it helpful?

Solution

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

It should be stored on a sdcard /Ringtones

If you want to save files that are not specific to your application and that should not be deleted when your application is uninstalled, save them to one of the public directories on the external storage. These directories lay at the root of the external storage, such as Music/, Pictures/, Ringtones/, and others.

and

In API Level 8 or greater, use getExternalStoragePublicDirectory(), passing it the type of public directory you want, such as DIRECTORY_MUSIC, DIRECTORY_PICTURES, DIRECTORY_RINGTONES, or others. This method will create the appropriate directory if necessary.

I read somewhere that you can put them in /media/ringtones but this isn't documented anywhere else. So you should use what they wrote in the docs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top