MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL) vs MediaStore.Video.Media.EXTERNAL_CONTENT_URI

from the CommonsWare Community archives

At March 26, 2020, 2:50pm, sudokai asked:

Hi,

I’m looking at this MediaStore video downloader example: https://gitlab.com/commonsguy/cw-android-q/blob/vFINAL/ConferenceVideos/src/main/java/com/commonsware/android/conferencevideos/VideoRepository.kt

And I can’t figure out what’s the difference between

MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL) 

and

MediaStore.Video.Media.EXTERNAL_CONTENT_URI

The second one seems to be an alias to the first?


At March 26, 2020, 3:05pm, mmurphy replied:

I can’t speak to the “alias” part. I had it in my head that getContentUri() was new to API Level 29, but according to the docs, it has been around since API Level 1. You may be able to just use MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL) for all versions.