Please select Into the mobile phone version | Continue to access the computer ver.
Close
You need to log in before you can reply       Login | Register now

[Android] How to programmatically download single photo images after startShootingPhoto...

Author: djiuser_YDobTsA 2017-9-8 17:46
1 54
Last edited by djiuser_YDobTsApZyT0 In 2017-9-8 17:46 Editor

I am currently writing an app that can programmatically take a single shot photo. I am successfully taking the photo and it's recorded on the SD card on the drone. When trying to download the photo onto the device I then attempt to start downloading the photo by setting the camera mode to MEDIA_DOWNLOAD and then "Fetching" the file. The problem occurs on the completionCallback of setting the camera mode (setMode()).
When I run this under the debugger, it works fine, but when running the app normally, it reports an error "Not Supported" when onResult triggers during the completionCallback.. Code snippet below.

I suspect there is a delay in changing modes and/or for the drone to store the photo it has just taken. So, I have tried to add a 5 second pause, which doesn't seem to have any effect. Is there an event that can tell me when the photo is ready for download to the device ?

MainApplication.getProductInstance()
        .getCamera()
        .setMode(SettingsDefinitions.CameraMode.MEDIA_DOWNLOAD,
                new CommonCallbacks.CompletionCallback() {
                    @Override
                    public void onResult(DJIError djiError) {
                        Handler handler = new Handler();
                        handler.postDelayed(new Runnable() {
                           @Override
                           public void run() {
                             if (djiError == null) {   <<<<======== error returns "Not Supported"
                               fetchMedia();
                             } else {
                               SnackbarUtils.make(mAppRootLyt, "Can't get file :" + djiError.getDescription());
                             }
    }
}, 5000);
                    }
                });



Reply
Replies
DJI SDK Support
Could you please give us more information on the drone type you are using/ The Media_download is not supported by X5 camera or X5R camera
2017-9-15 11:59
You need to log in before you can reply Login | Register now

Quick Reply Back to top Back to list
Quick Reply Back to top Back to list