Question

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"

Was it helpful?

Solution

 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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top