How to get the path to ringtones "/system/media/audio/ringtones" programmatically in Android?
Solution 1
If you want to work with ringtones use RingtoneManager because ringtones may be stored in few other directories. RingtoneManager
gives you all possible ringtones from your device.
Check also http://developer.android.com/guide/topics/data/data-storage.html#AccessingExtFiles and DIRECTORY_RINGTONES.
To directly answer your question there is no environment variable querying it you get the default ringtone directory.
Solution 2
As of Android 2.2 you can use DIRECTORY_RINGTONES
to get default ringtone directory
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES)
prasad.gai
every one have a day so use every one don't ignore any one
Updated on June 06, 2022Comments
-
prasad.gai almost 2 years
I have device with some ringtones at /system/media/audio/ringtones by default. I would like to get that path as programatically.I mean i would like to get the ringtones directory path from my device as programetically.