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.
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 Subsequent app starts will use locally cached verification information to register the app when the cached information is still valid.
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.
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.
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.
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.
Gets the path that flight logs are stored to. Flight logs are automatically generated 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.
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.