Instead of creating a thumbnail of a video saved on my device, I am trying to obtain the path of that thumbnail already created by the system.
This path is saved in the MediaStore Collection.
First, I access the video table and get the ID of a video that I know is on my device by passing it its path.
(I use a query to the SQL library, ContentResolver and the android.provider.MediaStore.Video$Media class)
Then, I try to access the path of the corresponding thumbnail in the video thumbnail table, querying with the obtained Id and comparing it with the Ids saved in that table, in the VIDEO_ID field, and which links the two tables.
(I use a query to the SQL library, ContentResolver and the android.provider.MediaStore.Video.Thumbnails class)
But I only get that route when I use my smartphone with Android 6 (API 23). With my smartphone with Android 11 (API 30) my application does not crash but it does not perform the query.
I guess it has something to do with the new scoped storage starting with Android 11.
I have already stated that if the android SdkVersion < 30, the WRITE_EXTERNAL_STORAGE permission is required, and if it is 30 or greater, the MANAGE_EXTERNAL_STORAGE permission is required. And the way to give permissions with RuntimePermissions and with an intent, respectively.
I also put
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
But I still can't get that route with Android 11.
Any ideas?