DJI Mobile SDK for Android V5

repository·dev-sdk-main·Indexed 19 days ago

https://github.com/dji-sdk/mobile-sdk-android-v5

A development kit for controlling DJI aircraft hardware and software interfaces via Android devices. It supports enterprise and consumer drone series including Mavic 3, Matrice, and Mini series. The SDK provides APIs for aircraft control and network functionality through modules such as dji-sdk-v5-aircraft and dji-sdk-v5-networkImp.

Tokens
1.2K
Snippets
2
Records
8
Agent score
18%

What's inside DJI Mobile SDK Android V5

  1. What is DJI Mobile SDK V5?

    dev-sdk-main
    DJI Mobile SDK V5 provides a series of APIs to control the software and hardware interfaces of DJI aircraft. It is designed to help developers build drone solutions on mobile devices by improving the experience and efficiency of MSDK App development. The SDK includes open-source production samples and tutorials.
  2. Overview of DJI Mobile SDK V5

    dev-sdk-main

    DJI Mobile SDK V5 provides streamlined hardware control interfaces and software service interfaces for drone development. It is designed to improve development efficiency with production-grade sample code and extensive tutorials.

    Supported Aircraft Models include:

    • DJI Mavic 3TA
    • Matrice 400
    • Matrice 4D Industry Series
    • DJI Mini 4 PRO
    • Matrice 4 Industry Series
    • Zenmuse H30 Series
    • DJI Mini 3 Pro
    • DJI Mini 3
    • Mavic 3 Industry Series
    • Matrice 30 Series
    • Matrice 300 RTK
    • Matrice 350 RTK
  3. Understand the Sample Code structure

    dev-sdk-main

    The SampleCode-V5 directory contains three main parts:

    1. Scenographic Example (uxsdk): Provides scenographic sample support for aircraft (currently aircraft only).
    2. Sample Module (sample): A compiled aircraft sample App that depends on uxsdk.
    3. Android SDK V5 AS (android-sdk-v5-as): Contains configuration files like settings.gradle for detailed setup.

    For specific configuration details, refer to SampleCode-V5/android-sdk-v5-as/settings.gradle.

  4. Integrate DJI Mobile SDK V5 into Android Studio

    dev-sdk-main

    To integrate the DJI Mobile SDK V5 into your Android Studio project, you must include the appropriate AAR dependencies in your build.gradle file. The SDK is split into functional modules to allow for optimized builds.

    Note: Ensure you replace {sdkVersion} with the specific version you are using (e.g., 5.18.0).

    // For aircraft support only
    implementation 'com.dji:dji-sdk-v5-aircraft:5.18.0'
    compileOnly 'com.dji:dji-sdk-v5-aircraft-provided:5.18.0'
    
    // Required for all network-dependent features (standard requirement)
    runtimeOnly 'com.dji:dji-sdk-v5-networkImp:5.18.0'
  5. Reference DJI Mobile SDK V5 AAR Dependencies

    dev-sdk-main

    The following AAR packages are available for DJI Mobile SDK V5 (sdkVersion = 5.18.0):

    SDK PackageDescriptionUsage Method
    dji-sdk-v5-aircraftMain aircraft package; provides MSDK support for aircraft control.implementation
    dji-sdk-v5-aircraft-providedProvided aircraft package; provides interfaces related to the aircraft package.compileOnly
    dji-sdk-v5-networkImpNetwork library package; provides networking capabilities. If omitted, all network-dependent MSDK features will be disabled, though hardware control interfaces will still function.runtimeOnly
  6. Add DJI SDK V5 dependencies via Gradle

    dev-sdk-main

    The SDK is distributed via AAR packages. Use the following dependency configurations in your build.gradle file.

    Note: Replace {sdkVersion} with the current version (e.g., 5.18.0).

    Required Packages

    SDK packageExplanationHow to use
    dji-sdk-v5-aircraftMain package for aircraft control.implementation 'com.dji:dji-sdk-v5-aircraft:{sdkVersion}'
    dji-sdk-v5-aircraft-providedCompilation package providing aircraft interfaces.compileOnly 'com.dji:dji-sdk-v5-aircraft-provided:{sdkVersion}'
    dji-sdk-v5-networkImpNetwork library package. Required for all network functions.runtimeOnly 'com.dji:dji-sdk-v5-networkImp:{sdkVersion}'

    Configuration Scenarios

    1. If you only need to support aircraft products:

    implementation 'com.dji:dji-sdk-v5-aircraft:{sdkVersion}'
    compileOnly 'com.dji:dji-sdk-v5-aircraft-provided:{sdkVersion}'

    2. If you need network functionality (required by default):

    runtimeOnly 'com.dji:dji-sdk-v5-networkImp:{sdkVersion}'
    // Scenario 1: Aircraft support only
    implementation 'com.dji:dji-sdk-v5-aircraft:5.18.0'
    compileOnly 'com.dji:dji-sdk-v5-aircraft-provided:5.18.0'
    
    // Scenario 2: Including network support
    runtimeOnly 'com.dji:dji-sdk-v5-networkImp:5.18.0'