How to fully release/destroy DJI SDK so that DJI Pilot 2 can take over (while running foreground-service)
I have an app which:
- Connects to the DJI SDK,
- Starts a foreground-service (for screen-sharing),
- Allows pilot to fly around in my piloting app
- Allows the user to switch to DJI Pilot 2 app (while foreground-service continues)
Problem: In step (4), when the foreground-service is running, my app seems to not "release" the DJI SDK, so the drone-video-feed in DJI Pilot 2 freezes every 5 seconds. This only happens when I am running the foreground-service.
I have tried calling:
dji.v5.manager.SDKManager.getInstance().destroy()
Inside the onStop() of my application (between steps (3) and (4)), and verified that it is called when I switch to DJI Pilot 2. But still, I get the problem (The drone video feed in DJI Pilot 2 freezes every 5 seconds or so)
So my question is: How can I fully "release" the DJI SDK so that the user can switch to DJI PIlot 2 and fly the drone while my foreground-service runs?
Thank you.
我有一个应用程序,它:
1)连接到 DJI SDK, 2)启动一个前台服务(用于屏幕共享), 3)允许飞手在我的飞行控制应用中操控无人机, 4)允许用户切换到 DJI Pilot 2 应用(前台服务继续运行)。
问题:在步骤 (4) 中,当前台服务正在运行时,我的应用似乎没有“释放”DJI SDK,因此在 DJI Pilot 2 中无人机的视频画面每隔 5 秒就会卡顿一次。只有在运行前台服务时才会出现这种情况。
我尝试在应用的 onStop() 方法中调用:
dji.v5.manager.SDKManager.getInstance().destroy()
(也就是在步骤 (3) 和 (4) 之间),并确认在切换到 DJI Pilot 2 时确实调用了它。 但问题仍然存在(DJI Pilot 2 中的视频画面大约每 5 秒会冻结一次)。
所以我的问题是:怎样才能完全释放DJI SDK,让用户在我的前台服务运行时,能切换到 DJI Pilot 2 并正常飞行?
非常感谢
Agent comment from YIGUI LIU in Zendesk ticket #160962:
Dear Developer,
Sorry, the MSDK APP and Pilot 2 APP are designed to be incompatible with simultaneous operation. Running both at the same time will cause aircraft control conflicts and abnormal app functions.
Before launching one of the apps, you must completely close and terminate the process of the other. This means the two apps cannot run concurrently, with one in the foreground and the other in the background. Frequent switching between the two apps will also lead to app malfunctions and crashes.
Best Regards,
DJI Innovations SDK Technical Support Team
°°°