DJI-Mobile-SDK-Tutorials / Android-MediaManagerDemo

This demo is designed for you to learn how to use the MediaManager to interact with the file system on the SD card of the aircraft's camera. You can use it to preview photos, play videos, download or delete files and so on.
MIT License
25 stars 19 forks source link

Unable to access photos and images from Mini 2 drone #18

Open Steve-Graf opened 2 years ago

Steve-Graf commented 2 years ago

I've pulled the most recent updates from this demo, but I'm running into an issue specifically with the Mini 2 not being able to download images nor videos from the SD card on the drone. I've double checked to ensure 4.16 is the SDK version being used in the build.gradle, and the initial screen that handles ConnectionActivity also confirms I'm on 4.16. Further, the demo is able to detect the Mini 2 drone (if I remember correctly, 4.15 wasn't able to properly return the Mini 2 model) and I'm able to enter the MainActivity.

The problem occurs when attempting to access the files on the SD card in the drone. I have no issues when connected to a Mini SE drone. A short "Please wait..." popup appears, and I'm soon able to preview/download videos and photos. The following screenshot is the expected, working view - taken when connected to the Mini SE:

MiniSE_mediamanager

When I restart the demo with the Mini 2 connected and follow the same steps, no popup is presented and this is what I see instead: Mini2_mediamanager

Any help on this would be appreciated, thanks!

iyush1993 commented 1 year ago

Hi @Steve-Graf, Did you ever manage to solve this? I am having the same issue. The problem is sometimes it loads the images. But most of the time, it fails with Media download result: the server aborts the downloading

Steve-Graf commented 1 year ago

@iyush1993 , I ended up having to revisit this specific issue and only recently put a solution in place. I've actually outlined the steps I took in a post I made on the DJI Developer Forums found here: https://forum.dji.com/forum.php?mod=viewthread&tid=275227

I'm not sure if these steps will fix your issues, but hopefully you can use parts of it to form an appropriate solution. To help summarize, the setMode function on the drone's camera does not work with Mini 2's, so you have to use enterPlaybackMode (note that this will disable your live camera feed to the drone until you return to whatever previous mode). You'll also need to ensure that your application has the appropriate permissions from the user. The example that I referenced in my forum post didn't seem up to date with the newest Android requirements. Hope this helps!