DJI Mobile SDK Documentation

      class DJISDKManager

      class DJISDKManager
      Package:dji.sdk.sdkmanager
      Description:

      This class is the entry point for using the SDK with a DJI product. Most importantly, this class is used to register the SDK, and to connect to and access the product. This class also provides access to important feature managers (such as getKeyManager), debugging tools, and threading control of asynchronous callbacks. SDK Registration using registerApp must be successful before the SDK can be used with a DJI product.

      Class Members:

      SDK Admin

      SDK Information
      method
      method getSDKVersion
      String getSDKVersion()
      Package:dji.sdk.sdkmanager
      Description:

      Gets the DJI Mobile SDK Version. Returns SDK version as a string.

      Return:
      StringA SDK version String instance.
      App Registration
      method
      method registerApp
      void registerApp(final Context inContext, SDKManagerCallback callback)
      Package:dji.sdk.sdkmanager
      Description:

      The first time the app is initialized after installation, the app connects to a DJI Server through the internet to verify the Application Key. The request will include the following information:

      - App key
      - Bundle ID
      - Device UUID generated from hashed mobile device ID (getDeviceID), hashed SIM serial number (getSIMSerialNumber) and hashed ANDROID ID (Secure.ANDROID_ID). If READ_PHONE_STATE permission is not permitted, a random UUID is generated.
      - System platform, version and name
      - UUID generated by platform's API ([UIDevice)
      - Mobile device model
      - Internet related feature initialisation.
      Subsequent app starts will use locally cached verification information to register the app when the cached information is still valid.

      Input Parameters:
      SOURCE_DIFFERENT contextAndroid context.
      SDKManagerCallback callbackCallback used for both the registration result, and when the products changes.
      method registerAppForLDM
      void registerAppForLDM(final Context inContext, SDKManagerCallback callback)
      Package:dji.sdk.sdkmanager
      Description:

      Designed for LDM feature LDMManager. The first time the app is initialized after installation, the app connects to a DJI Server through the internet to verify the Application Key. The request will include the following information:

      - App key
      - Bundle ID
      - Device UUID generated from hashed mobile device ID (getDeviceID), hashed SIM serial number (getSIMSerialNumber) and hashed ANDROID ID (Secure.ANDROID_ID). If READ_PHONE_STATE permission is not permitted, a random UUID is generated.
      - System platform, version and name
      - UUID generated by platform's API ([UIDevice)
      - Mobile device model
      - Internet related feature initialisation (not included)
      After successfully registered, the app will enter LDM mode. Subsequent app starts will use locally cached verification information to register the app when the cached information is still valid.

      Input Parameters:
      SOURCE_DIFFERENT contextAndroid context.
      SDKManagerCallback callbackCallback used for both the registration result, and when the products changes.
      method hasSDKRegistered
      @Deprecated
      boolean hasSDKRegistered()
      Package:dji.sdk.sdkmanager
      Description:

      Registration state.

      Return:
      booleantrue if SDK is registered.
      USB Accessory Attached
      final USB_ACCESSORY_ATTACHED
      static final String USB_ACCESSORY_ATTACHED = SDKRelativeJNI.native_getUsbAccessoryAttachedString()
      Package:dji.sdk.sdkmanager
      Description:

      When this string is received in a broadcast, the SDK will attempt to connect to USB accessory.

      SDK Manager
      method
      method getInstance
      synchronized static DJISDKManager getInstance()
      Package:dji.sdk.sdkmanager
      Description:

      Accessor for DJISDKManager object.

      Return:
      synchronized static DJISDKManagerAn instance of DJISDKManager object.
      method setCallbackRunInUIThread
      void setCallbackRunInUIThread(boolean enable)
      Package:dji.sdk.sdkmanager
      Description:

      Determines whether asynchronous getter and setter method callbacks should be invoked in UIThread or BackgroundThread. This method is only for setters and getters, as push data callbacks (typically state data) always return in the BackgroundThread.

      Input Parameters:
      boolean enableA boolean value.
      AOA Connection
      method
      method closeAOAConnection
      void closeAOAConnection()
      Package:dji.sdk.sdkmanager
      Description:

      This method is used to close the AOA connection during development and should not be used in the final application. When using AS or Eclipse to build and run the application, the AOA connection is not properly closed if the application is terminated. As a result, the next time the application is run, the SDK will not be able to connect to the product without first disconnecting and reconnecting the USB cable. AS and Eclipse can be configured to invoke this method before compiling the application, closing the link before the application is run, and overcoming this problem.

      App Activation Manager
      method
      method getAppActivationManager
      AppActivationManager getAppActivationManager()
      Package:dji.sdk.sdkmanager
      Description:

      Used to check the states related to the App Activation.

      Return:
      AppActivationManagerAn instance of AppActivationManager.
      RTK Network Service Provider
      method
      method getRTKNetworkServiceProvider
      RTKNetworkServiceProvider getRTKNetworkServiceProvider()
      Package:dji.sdk.sdkmanager
      Description:

      Accesses the RTK network service provider.

      Return:
      RTKNetworkServiceProviderAn instance of RTKNetworkServiceProvider.
      Component Upgrade
      method
      method getUpgradeManager
      UpgradeManager getUpgradeManager()
      Package:dji.sdk.sdkmanager
      Description:

      Provide access to UpgradeManager used to manage components upgrade.

      Return:
      UpgradeManagerAn instance of UpgradeManager.
      UAS Remote ID
      method
      method getUasRemoteIDManager
      UASRemoteIDManager getUasRemoteIDManager()
      Package:dji.sdk.sdkmanager
      Description:

      Provide access to UASRemoteIDManager used to manage UA SRemote ID.

      Return:
      UASRemoteIDManagerAn instance of DJIUASRemoteIDManager.


      Product Connection

      Product
      method
      method getProduct
      BaseProduct getProduct()
      Package:dji.sdk.sdkmanager
      Description:

      The DJI product which is connected to the mobile device, only available after successful registration of the app.

      Return:
      BaseProductAn instance of BaseProduct.
      method getBluetoothProductConnector
      BluetoothProductConnector getBluetoothProductConnector()
      Package:dji.sdk.sdkmanager
      Description:

      Used to establish the Bluetooth connection between the mobile device and the DJI product. The Bluetooth connection needs to be established before a connection between the SDK and the DJI product can be made using startConnectionToProduct.

      Return:
      BluetoothProductConnectorA BluetoothProductConnector instance.
      method setSupportOnlyForBluetoothDevice
      void setSupportOnlyForBluetoothDevice(boolean isBluetoothDevice)
      Package:dji.sdk.sdkmanager
      Description:

      If only Bluetooth devices will be connected, then this should be set to true.

      Input Parameters:
      boolean isBluetoothDevicetrue if only Bluetooth devices will be connected.
      Connection
      method
      method startConnectionToProduct
      boolean startConnectionToProduct()
      Package:dji.sdk.sdkmanager
      Description:

      Starts a connection between the SDK and the DJI product. This method should be called after successful registration of the app and once there is a data connection between the mobile device and DJI product. This data connection is either a USB cable connection, a WiFi connection (that needs to be established outside of the SDK) or a Bluetooth connection (that needs to be established with getBluetoothProductConnector). If the connection succeeds, onProductConnect will be called if the connection succeeded. Returns true if the connection is started successfully. For products which connect to the mobile device using Bluetooth, getBluetoothProductConnector should be used to get a BluetoothProductConnector object which can handle Bluetooth device connection.

      Return:
      booleantrue if the connection is started successfully.
      method stopConnectionToProduct
      void stopConnectionToProduct()
      Package:dji.sdk.sdkmanager
      Description:

      Disconnect from the connected DJI product.


      Debug and Logging

      method enableBridgeModeWithBridgeAppIP
      void enableBridgeModeWithBridgeAppIP(String bridgeAppIP)
      Package:dji.sdk.sdkmanager
      Description:

      Enter debug mode with debug IP.

      Input Parameters:
      String bridgeAppIPDebug IP of the DJI Bridge App.


      Get Log Path

      Log Path
      method
      method getLogPath
      @NonNull
      String getLogPath()
      Package:dji.sdk.sdkmanager
      Description:

      Gets the path that flight logs are stored to. Flight logs are automatically defineed by MSDK and stored on the mobile device. The SDK does nothing with these logs, and they are provided only as a convenience for developers and users. Users can use these flight logs with DJI service centers if they are making a warranty claim. Only developers using the SDK, and users of the mobile device can access these logs. Older flight logs are overwritten by newer flight logs over time, so the flight log path is given in case an application needs to store all logs.

      Return:
      StringAn NSString object of the flight log path.
      method getFlycLogPath
      String getFlycLogPath()
      Package:dji.sdk.sdkmanager
      Description:

      Gets the path that flight control compact logs are stored to. Flight control compact logs are defined by flight controller and stored on the mobile device. The SDK does nothing with these logs, and they are provided only as a convenience for developers and users. Users can use these flight logs with DJI service centers if they are making a warranty claim. Only developers using the SDK, and users of the mobile device can access these logs. Older flight logs are overwritten by newer flight logs over time, so the flight log path is given in case an application needs to store all logs. Supported by DJI Air 2S, DJI Mini 2, DJI Mini SE, Mavic Air 2, Mavic Mini, Mavic Pro, Phantom 4 Pro, Matrice 300 RTK.

      Return:
      StringAn NSString object of the flight control compact log path.


      Managers

      Fly Zones
      method
      method getFlyZoneManager
      FlyZoneManager getFlyZoneManager()
      Package:dji.sdk.sdkmanager
      Description:

      Provide access to FlyZoneManager used to manage DJI's GEO system for no fly zones.

      Return:
      FlyZoneManagerAn instance of FlyZoneManager.
      SDK Keys
      method
      method getKeyManager
      @Nullable
      KeyManager getKeyManager()
      Package:dji.sdk.sdkmanager
      Description:

      Provide access to the SDK Key interface.

      Return:
      KeyManagerAn instance of KeyManager.
      Mission Control
      method
      method getMissionControl
      MissionControl getMissionControl()
      Package:dji.sdk.sdkmanager
      Description:

      Provide access to MissionControl used to manage missions.

      Return:
      MissionControlAn instance of MissionControl.
      Flighthub
      method
      method getFlightHubManager
      FlightHubManager getFlightHubManager()
      Package:dji.sdk.sdkmanager
      Description:

      Provide access to FlightHubManager. It can be used to interact with DJI FlightHub (https://www.dji.com/flighthub).

      Return:
      FlightHubManagerAn instance of FlightHubManager.
      Live Stream
      method
      method getLiveStreamManager
      LiveStreamManager getLiveStreamManager()
      Package:dji.sdk.sdkmanager
      Description:

      Provides access to getLiveStreamManager. It can be used to stream the video to a RTMP server to do live streaming with DJI products.

      Return:
      LiveStreamManagerAn instance of getLiveStreamManager.


      LDM

      Local Data Mode
      method
      method getLDMManager
      LDMManager getLDMManager()
      Package:dji.sdk.sdkmanager
      Description:

      Manages Local Data Mode (LDM) functionality. Local data mode gives the developer the option to put the SDK into airplane mode, restricting its access to the internet. See LDMManager for details on when and where this is possible, and what is restricted.

      Return:
      LDMManagerAn instance of LDMManager.


      State Updates
      class
      SDK Init Event
      class