DJI-Mobile-SDK-Tutorials / Android-GSDemo-GoogleMap

A Demo for using DJI Mobile SDK to create a Waypoint Mission App using Google Map.
MIT License
26 stars 55 forks source link

Why not have a private DJIBaseProduct product? #4

Closed Berserk0r closed 6 years ago

Berserk0r commented 7 years ago

Is there a deeper meaning to why "DJIBaseProduct product = DJIDemoApplication.getProductInstance();" is called so often instead of declaring a private variable DJIBaseProduct, initializing it one time in the onResume method? Or could there be problems?

Thanks for the help :)

dji-dev commented 7 years ago

Hi, thanks for your feedback. Actually, the reason to call "DJIDemoApplication.getProductInstance()" each time is that it can ensure the DJIBaseProduct you get is the latest one. When you switch to different product the DJIBaseProduct may change. BTW, if you want to declare a private variable to store the DJIBaseProduct, it's OK too. You can test it. Hope this hope.

Berserk0r commented 7 years ago

Thanks for the quick response :) I have another question, because I'm waiting to get a phantom and therefore can't really check what I'm coding but I would like to make everything work until it gets here, maybe you could help me out again if this is not so offtopic: : What exactly happens to the drone when you invoke mMissionManager.stopMissionExecution(new DJICommonCallbacks.DJICompletionCallback() in your code? (Also pauseMissionExecution). Does the drone land or does it hover in the air? And does startMissionExecution resume the aborted mission or does it begin at the beginning? I hope I can ask these questions in the context of the Demo here, if this is not the right site to ask this, excuse me :)

dji-dev commented 7 years ago

Hi, please refer to the tutorial of this sample code: Creating a MapView and Waypoint Application, it has already been updated to Android SDK 3.3 and explain your questions in details. Hope this help!