在 DJI Android SDK 中调用 refreshFileListOfStorageLocation() 需要很多秒才能产生结果(mavic

Calling refreshFileListOfStorageLocation() in the DJI Android SDK takes many seconds to produce a result (mavic

我正在编写的程序的目标如下:

代码就是这样做的。问题是,整个过程需要超过 5 秒,有时甚至需要 15 秒才能完成。主要瓶颈是 refreshFileListOfStorageLocation() 函数。

代码设置如下:


mMediaManager = DJISampleApplication.getProductInstance().getCamera().getMediaManager();
camera = DJISampleApplication.getProductInstance().getCamera();

camera.startShootPhoto(new CommonCallbacks.CompletionCallback() {
    @Override
    public void onResult(DJIError djiError) {
        mMediaManager.refreshFileListOfStorageLocation(SettingsDefinitions.StorageLocation.INTERNAL_STORAGE, new CommonCallbacks.CompletionCallback() {
        @Override
        public void onResult(DJIError djiError) {
        newPicture();
    });
});


void newPicture() {
mediaFileList = mMediaManager.getInternalStorageFileListSnapshot();
MediaFile lastImage = mediaFileList.get(mediaFileList.size()-1);
lastImage.fetchFileData(destDir, names[0], new DownloadListener<String>() {
    @Override
    public void onSuccess(String s) {
        deleteAllFilesFromDrone();
    return;
    }
}

就像我说的,这行得通;问题是 refreshFileListOfStorageLocation()onResult 之间的时间。

有什么办法可以加快速度吗?我试过:

none 其中有帮助。

根据我与大疆开发者支持的通信:

Unfortunately, the universal answer is that the speed is what it is and there's not anything that can be done to speed up the process other than downloading a preview of the media file or manually taking the SD card out and downloading the media directly onto a computer.

所以看起来似乎不可能通过任何 API 技巧进一步提高速度。