I need to get the byte data of the latest (and only the one) media file from the SDCard. As of now, it seems to be the case that the only way to achieve this is to fetch the list of all the media files on the SDCard using the MediaManager.sdCardFileListSnapshot, then sorting the list in descending order of time created, picking the first item in that list, then call the fetchFileByteData on it. This entire procedure takes too long, often leading to the error "Execution of this process has timed out".
Is there a way to do this more efficiently, or is this the only way?
I need to get the byte data of the latest (and only the one) media file from the SDCard. As of now, it seems to be the case that the only way to achieve this is to fetch the list of all the media files on the SDCard using the
MediaManager.sdCardFileListSnapshot
, then sorting the list in descending order of time created, picking the first item in that list, then call thefetchFileByteData
on it. This entire procedure takes too long, often leading to the error "Execution of this process has timed out".Is there a way to do this more efficiently, or is this the only way?
Any help is appreciated.