-
Notifications
You must be signed in to change notification settings - Fork 55
Installation
There are various ways this library can be installed and used by developers.
If you wish to just use this library without making any modifications to the source code, you can use jitpack.io
to directly add the dependency to your application using the following steps.
- Add the following at the end of your root
build.gradle
under "repositories" -
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency to your application's
build.gradle
file with the version you want -
dependencies {
...
implementation 'com.github.dji-sdk:Mobile-UXSDK-Beta-Android:v0.4.0'
}
- Ensure your app-level
build.gradle
file includes thepackagingOptions
,dexOptions
,compileOptions
and MSDK dependencies as specified here.
More information from jitpack.io
on how this can be done here.
- Clone the library using git or download it, and open it in Android Studio.
- Modify the source code if and as required.
If you do not intend to modify the code very often and would like to keep your application's code clean, you can include the library as an AAR file. Since Beta 3, UX SDK has been split into various modules so you can pick and choose what you need. The modules wiki contains information on what each module provides.
- To build an AAR package with the UX SDK library, open a terminal and navigate to the git folder you have cloned the repository into -
cd path/to/git/folder
- Navigate to the
scripts
folder inside the UX SDK repository - Run the command
python uxsdkCreateAAR.py
. This will generate an AAR for each module in the same folder where the script ran. - Once the scripts finishes, in your file manager navigate to the following folder -
GitClonedFolder -> scripts -> android-uxsdk-beta
. In this folder you will find an AAR for each UX SDK module that you can include in your project. - To include the files, open your application in Android Studio. Go to
File -> New -> New Module
. SelectImport .JAR/.AAR Package
from the list and click next. Enter the location of the compiled AAR above and then click finish. Repeat this step for each of the modules you want to add to your application. - Make sure the library is listed at the top of your settings.gradle file - e.g.,
include ':app', ':android-uxsdk-beta-core'
,':android-uxsdk-beta-cameracore'
and so on for any other module you need for your application. - Open your app module's
build.gradle
file and add the following to the dependencies block -implementation project(":android-uxsdk-beta-core")
. Similarly, add any other UX SDK modules you want for your application. - Click
Sync Project with Gradle Files
.
If you intend to make regular changes to the source code, you can directly include the UX SDK library as a module in your application.
- Open your application in Android Studio and click
File -> New -> Import Module
. - Enter the location of the module, e.g., for core that is
android-uxsdk-beta-core
folder and click finish. This copies the library module to your project so you can edit the code as you need. - Make sure the library is listed at the top of your settings.gradle file -
include ':app', ':android-uxsdk-beta-core'
. - Open the app module's
build.gradle
file and add the following to the dependencies block -implementation project(":android-uxsdk-beta-core")
. Repeat this process for other UX SDK modules you want for your application. - Click
Sync Project with Gradle Files
.
More information on how this can be done using Android Studio can be found here and here.
DJI UX SDK Version 5 Beta 5
UX SDK 5.0 Overview
Core Module
Camera Core Module
Visual Cameras Module
- Camera Config