dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
994 stars 581 forks source link

Efficient way to fetch the latest Media File #1182

Closed dkapur17 closed 2 years ago

dkapur17 commented 2 years ago

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?

Any help is appreciated.

DJI-William commented 2 years ago

There is no other way to do that.