I found this tutorial and am trying to implement it in my project http://www.androiddevblog.net/android/playing-audio-in-android
I want to read music from res/raw folder instead of external storage
Cursor cursor = getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, null);
Here is my code:
Cursor cursor = getContentResolver().query( MediaStore.Audio.Media.getContentUri("android.resource://com.varma.samples.musicplayer/raw/"), null, null, null, null);
Of course the Uri does not return anything and I want to get the audio from res/raw...
Thank you!!
EDIT:
Thank you both, I won't use a cursor then ;)
If it helps somebody I am using this for get all songs:
Field[] fields = R.raw.class.getFields();