Piolo Opaw
Piolo Opaw

Reputation: 1511

How to get all video files in specific folder in android phone external storage?

I create a method that upload and save the video in "/download" folder in external storage in the android phone, if i use MediaStore.Video.Media.EXTERNAL_CONTENT_URI all video files will be included, i want to know how to get the exact path of the "/download" folder in the phone storage?

because if i use this

private static final Uri sourceUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;

videoCursorTitle = getContentResolver().query(sourceUri, projection,
                null, null, orderByTITLE);

if i use that it gets all the video from the external storage, how to get video in a specific folder? folder name is "/download"

Upvotes: 3

Views: 7465

Answers (1)

Bhanu Sharma
Bhanu Sharma

Reputation: 5145

 String selection=MediaStore.Video.Media.DATA +" like?";
            String[] selectionArgs=new String[]{"%FolderName%"};
            videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
                    parameters, selection, selectionArgs, MediaStore.Video.Media.DATE_TAKEN + " DESC");

Upvotes: 4

Related Questions