I am trying this code for geting a playlist.
final String MEDIA_PATH=new String(MediaStore.Audio.Media.IS_MUSIC+\"!=0\");
//final String MEDIA_PATH=new Str
Try this :
String[] STAR = { "*" }; int totalSongs; public void ListAllSongs() { Uri allsongsuri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0"; if (MusicUtils.isSdPresent()) { cursor = managedQuery(allsongsuri, STAR, selection, null, null); totalSongs = cursor.getCount(); if (cursor != null) { if (cursor.moveToFirst()) { do { String songname = cursor .getString(cursor .getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME)); int song_id = cursor.getInt(cursor .getColumnIndex(MediaStore.Audio.Media._ID)); String fullpath = cursor.getString(cursor .getColumnIndex(MediaStore.Audio.Media.DATA)); fullsongpath.add(fullpath); String albumname = cursor.getString(cursor .getColumnIndex(MediaStore.Audio.Media.ALBUM)); int album_id = cursor .getInt(cursor .getColumnIndex(MediaStore.Audio.Media.ALBUM_ID)); String artistname = cursor.getString(cursor .getColumnIndex(MediaStore.Audio.Media.ARTIST)); int artist_id = cursor .getInt(cursor .getColumnIndex(MediaStore.Audio.Media.ARTIST_ID)); } while (cursor.moveToNext()); } cursor.close(); } } }
EDITED:
You check out the below links to show all video file stored in your sd card in a listview.
1) Link 1
2) Link 2
3) Link 3
I hope it will help you .
Thanks.