DJI Mobile SDK Documentation
      Package:dji.v5.manager.interfaces
      classSince MSDK 5.0.0

      IKeyManager

      The class to manage the MSDK keys, MSDK provides a series of methods to access and control the parameters and behaviors of the hardware module which include the set and get method of a DJIKeyvalue.

      Package dji.v5.manager.interfacesAndroid · Java / Kotlin

      The class to manage the MSDK keys, MSDK provides a series of methods to access and control the parameters and behaviors of the hardware module which include the set and get method of a DJIKeyvalue. Also they include the listener and action of theDJIKeyvalue. You can use createKey method fromKeyToolsclass to create an instance of DJIKey more easily.

      Supported since MSDK 5.0.0

      Members

      15 members

      Method

      11

      Class

      4
      method
      method

      getValue

      @Nullable
      <R> R getValue(DJIKey<R> key)

      Obtain the DJIValue value of the DJIKey synchronously, which is the value obtained from the MSDK cache. To get the value asynchronously from the hardware device, please call getValue.

      Parameters

      NameTypeDescription
      keyDJIKey<R> DJIKey instance.

      Return

      NameDescription
      <R> RReturn DJIValue value.
      method
      method

      getValue

      @NonNull
      <R> R getValue(DJIKey<R> key, @NonNull R defaultValue)

      Obtain the DJIValue value of the DJIKey synchronously, which is the value obtained from the MSDK cache. If the value cannot be read, the set defaultValue will be returned. To get the value asynchronously from the hardware device, please call getValue.

      Parameters

      NameTypeDescription
      keyDJIKey<R> DJIKey instance.
      defaultValue@NonNull R When the MSDK cache value cannot be read, will return the default value.

      Return

      NameDescription
      <R> RReturn DJIValue value.
      method
      method

      getValue

      <R> void getValue(DJIKey<R> key, CommonCallbacks.CompletionCallbackWithParam<R> callback)

      Get the DJIValue value of DJIKey asynchronously, which is the value obtained from the hardware device. To read the value from the MSDK cache, please call getValue.

      Parameters

      NameTypeDescription
      keyDJIKey<R> DJIKey instance.
      callbackCommonCallbacks.CompletionCallbackWithParam<R> Return callback of the execution result.
      method
      method

      setValue

      <P> void setValue(DJIKey<P> key, P param, CommonCallbacks.CompletionCallback callback)

      Set the parameter of DJIKey.

      Parameters

      NameTypeDescription
      keyDJIKey<P> DJIKey instance.
      paramP Parameter set.
      callbackCommonCallbacks.CompletionCallback Return callback of the execution result.
      method

      performAction

      <R> void performAction(DJIKey.ActionKey<?, R> key, CommonCallbacks.CompletionCallbackWithParam<R> callback)

      Execute the Action behavior of DJIKey.

      Parameters

      NameTypeDescription
      keyDJIKey.ActionKey<?, R> DJIKey instance.
      callbackCommonCallbacks.CompletionCallbackWithParam<R> Return callback of the execution result.
      method

      performAction

      <P, R> void performAction(DJIKey.ActionKey<P, R> key, P param, CommonCallbacks.CompletionCallbackWithParam<R> callback)

      Execute the Action behavior of DJIKey with parameters.

      Parameters

      NameTypeDescription
      keyDJIKey.ActionKey<P, R> DJIKey instance.
      paramP Action parameter.
      callbackCommonCallbacks.CompletionCallbackWithParam<R> Return callback of the execution result.
      method
      method

      listen

      <R> void listen(DJIKey<R> key, Object listenHolder, CommonCallbacks.KeyListener<R> callback)

      Listen to the DJIValue value of DJIKey.

      Parameters

      NameTypeDescription
      keyDJIKey<R> DJIKey instance.
      listenHolderObject The holder of the listener.
      callbackCommonCallbacks.KeyListener<R> Return callback of the execution result.
      method
      method

      listen

      <R> void listen(DJIKey<R> key, Object listenHolder, boolean getOnce, CommonCallbacks.KeyListener<R> callback)

      Listen to the DJIValue value of DJIKey. While listening, the DJIValue value can be obtained asynchronously once.

      Parameters

      NameTypeDescription
      keyDJIKey<R> DJIKey instance.
      listenHolderObject The holder of the listener.
      getOnceboolean true means that the value is obtained asynchronously once while listening.
      callbackCommonCallbacks.KeyListener<R> Return callback of the execution result.
      method

      cancelListen

      void cancelListen(DJIKey<?> key, Object listenHolder)

      Cancel the listening of specific DJIKey and specific listenHolder.

      Parameters

      NameTypeDescription
      keyDJIKey<?> DJIKey instance.
      listenHolderObject The holder of the listener.
      method

      cancelListen

      void cancelListen(DJIKey<?> key)

      Cancel the listening of specific DJIKey.

      Parameters

      NameTypeDescription
      keyDJIKey<?> DJIKey instance.
      method

      cancelListen

      void cancelListen(Object listenHolder)

      Cancels all listeners for a specific Holder.

      Parameters

      NameTypeDescription
      listenHolderObject Holder Listener.
      class

      KeyTools

      Since MSDK 5.0.0
      @Keep
      class KeyTools

      Key tool class.

      class

      KeyListener

      Since MSDK 5.0.0
      interface KeyListener<T>

      Used to monitor whether the key value is updated.

      class
      class

      DJIKey

      Since MSDK 5.0.0
      class DJIKey<T>

      Base class for all Key module classes supported by MSDK.

      class

      DJIValue

      interface DJIValue

      Base class for all Value classes supported by MSDK.