How to programmatically launch the path to the ringtone "/ system / media / audio / ringtones"?

I have a device with some tunes in / system / media / audio / ringtones by default. I would like to get this path as programatically. I mean I would like to get the path to the ringtone directory from my device as programmatically.

+3
source share
4 answers

If you want to work with ringtones, use RingtoneManager , because ringtones can be stored in several other directories. RingtoneManagergives you all the possible ringtones from your device. Also check out http://developer.android.com/guide/topics/data/data-storage.html#AccessingExtFiles and DIRECTORY_RINGTONES .

To directly answer your question, there is no environment variable requesting it, you get a standard ringtone.

0
source

Starting with Android 2.2 you can use DIRECTORY_RINGTONESto get the default ringtone directory

Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES)
+1
source

RingtoneManager. getDefaultUri() , .

0
Intent i =new Intent(Intent.ACTION_VIEW);

Uri u = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");

i.setData(u);

startActivity(i);
0

All Articles