DJI Mobile SDK Documentation

      class KeyManager

      class KeyManager
      Package:dji.keysdk
      Description:

      KeyManager provides access to the keyed interface using DJIKey and corresponding subclass objects. KeyManager is accessed from getKeyManager in DJISDKManager.

      Class Members:
      method
      method getValue
      @Nullable Object getValue(@NonNull DJIKey key)
      Package:dji.keysdk
      Description:

      Returns the latest known value if available for the key. Does not pull it from the product if unavailable.

      Input Parameters:
      @NonNull DJIKey keyAn instance of DJIKey.
      Return:
      @Nullable ObjectThe value associated with the key.
      method
      method getValue
      void getValue(@NonNull DJIKey key, @NonNull final GetCallback callback)
      Package:dji.keysdk
      Description:

      Performs a get on a gettable key, pulling the information from the product if necessary.

      Input Parameters:
      @NonNull DJIKey keyA valid gettable key
      @NonNull final GetCallback callbackA valid get callback.
      method
      method setValue
      void setValue(@NonNull DJIKey key, @NonNull Object value, @Nullable final SetCallback callback)
      Package:dji.keysdk
      Description:

      Performs a set on a settable key, changing attributes on the connected product.

      Input Parameters:
      @NonNull Object valueA value object relevant to the given key
      @NonNull DJIKey keyA valid settable key
      @Nullable final SetCallback callbackA set callback.
      method performAction
      void performAction(@NonNull DJIKey key, @Nullable final ActionCallback callback, final Object... arguments)
      Package:dji.keysdk
      Description:

      Performs an action on an actionable key.

      Input Parameters:
      @NonNull DJIKey keyA valid actionable key
      final Object... argumentsOptional arguments relevant to the specific key
      @Nullable final ActionCallback callbackAn action callback.
      method addListener
      void addListener(@NonNull DJIKey key, @NonNull final KeyListener listener)
      Package:dji.keysdk
      Description:

      Subscribes the listener object to all changes of value on the given key.

      Input Parameters:
      @NonNull DJIKey keyA valid value-based key (get, set and/or action)
      @NonNull final KeyListener listenerA valid object to hold the subscription
      method removeListener
      void removeListener(@NonNull final KeyListener listener)
      Package:dji.keysdk
      Description:

      Stops the subscription to updates of a specific key value for a specific listener. Does not affect other listeners subscribing to this key or other subscriptions of the listener.

      Input Parameters:
      @NonNull final KeyListener listenerThe listener object passed at the moment of calling startListening.
      method isKeySupported
      boolean isKeySupported(@NonNull DJIKey key)
      Package:dji.keysdk
      Description:

      Determines if a key is supported by the connected product.

      Input Parameters:
      @NonNull DJIKey keyKey to be check on current product.
      Return:
      booleantrue if the key is supported.
      method
      method removeKey
      void removeKey(DJIKey key)
      Package:dji.keysdk
      Description:

      Remove a key's cache value.

      Input Parameters:
      DJIKey keyKey to be removed on current product.
      class