Module Example

2026-11-04Loading rating…

1. Sample Overview

The SDK interfaces provided by MSDK 5.20 are organized into independent modules, through which you can integrate with the Pilot platform:

  • Add UI widgets to the floating window provided by Pilot
  • Annotate information on the LiveView
  • Project target points into the AR view
  • Pop up dialogs to collect user input
  • ......

The DJI Pilot Plugin Sample develops demo cases module by module; you can open them one by one and see the actual effect on a real device. The Sample is fully open-source, and each case marks the corresponding interface class and implementation code location, so you can copy and adapt it directly. This article is for developers new to Pilot Open capabilities. It introduces, per module, what each case demonstrates and what effect you will see, without covering interface call details.

To download or browse the project source, see Get the Sample Source Code at the end of this article.

Remote controller home

Remote controller home

Plugin management - disconnected

Plugin management - disconnected

2. Prerequisites

Before trying out the module cases, you need to meet the following conditions.

  • The plugin is registered online
  • The plugin is connected to the Pilot server
  • The aircraft is connected
  • Permissions granted (some modules depend on permissions such as file access)

The module cards on the main screen are clickable only when connected and registered. If the status is not ready, tapping a card prompts you to complete the connection first.

Unregistered state

Unregistered state

Not-connected prompt

Not-connected prompt

Plugin connection state

Plugin connection state

3. Common Experience Path

Except for "Wayline Mission", most modules follow the same experience path:

  1. Tap a module card on the main screen to enter that module's Demo page.
  2. On the Demo page, select a case from the left menu; the right side shows the case's description and preview.
  3. Tap the "View Effect" button on the right, and the screen switches to Pilot automatically.
  4. Operate in the floating window on Pilot's UI, and the actual effect is presented directly on Pilot's map, video feed, or UI.
  5. Tap "Back to Plugin App" at the bottom of the floating window to return to the plugin and continue with the next case.

The top navigation bar of the floating window has left/right arrows, letting you quickly switch between different cases of the same module without returning to the plugin repeatedly.

Button sample case

Sample case preview

Floating window case - Button

Pilot floating window

Note: The floating window is globally unique. When you switch from one module to another, the floating window content is redrawn and overwritten by the new module—this is expected behavior, not an anomaly.


4. How to Find the Corresponding Code

On the right-side card of each case, two path lines are shown right above the "View Effect" button:

Interface class: dji/open/pilot/client/interfaces/IARManager.java
Reference code: sampleitem/armanager/drawing/ARPointDrawer.kt

The meaning of the two lines:

  • Interface class: where the open interface called by this case is located, used to look up the interface definition and parameter descriptions. Widgets in the "Custom UI Components" module don't go through an interface class, so this line shows a wrapper class pointing to the widget's wrapper implementation.
  • Reference code: the source location that actually implements this case in the Sample, relative to the plugin project's source root.

When you see an effect in the plugin and want to know how it's made, just follow these two path lines into the project—no global search needed.

Sample case - code location


5. Module Overview

ModuleCapabilityCasesTutorial
Custom UI ComponentsOverlay your own widgets on Pilot's UI, covering 11 types such as layout, text, button, input, switch, image, and list25Custom UI Components doc
AR ProjectionProject points, lines, polygons, and circles into the AR view, and enable the radar scan range5AR Projection doc
DialogPop up five types of standard dialogs in Pilot: tip, confirm, input, single-choice, multi-choice5Dialog doc
Camera View DrawingOverlay detection boxes, polygon areas, and real-time text on the video feed3Camera View Drawing doc
Page NavigationNavigate Pilot to designated pages such as home, map, wayline, and album8Page Navigation doc
Wayline MissionImport a local KMZ wayline file into Pilot1—

6. Custom UI Components

This module demonstrates how to overlay the plugin's own widgets on Pilot's UI. You can organize these remote widgets just like writing an Android layout—set text, color, size, and alignment, and update their properties at runtime. The module provides 11 widget types and 25 cases, presented in the left menu in three groups: "Basic Components / Data Input / Data Display".

6.1 Basic Components

WidgetDemo highlightsCases
LayoutWeight distribution and alignment for linear layout; four-corner and center positioning for relative layout5
TextFont size, bold, italic, color, underline, strikethrough, and truncation and scrolling3
ButtonFour button styles, tab-style button groups, and text properties3

6.2 Data Input

WidgetDemo highlightsCases
Input fieldStyle customization, plus input controls such as number, password, auto-grouping, and character limits2
CheckBoxChecked state, disabled state, and color scheme1
SwitchOn/off state, thumb and track color scheme, and disabled state1
SpinnerDefault selected item and dropdown panel color scheme1

6.3 Data Display

WidgetDemo highlightsCases
ImageBackground shape, six scale-fill modes, and tinting3
WebViewLoad a real web page inside the floating window1
ListViewMultiple data rows, dividers, and click response1
ProgressBarHorizontal and circular forms, with progress, color, text, and success/failure states4

6.4 Experience Flow

  1. Select a widget type from the left menu.
  2. Select a case from the case list on the right; the card shows the case's effect preview.
  3. Tap "View Effect", the screen switches to Pilot, and the floating window presents the case's actual rendered result.
  4. Use the left/right arrows at the top of the floating window to switch to other widgets, or tap "Back to Plugin App" to return to the plugin.

Sample case - Custom UI components

Sample case

Floating window case - Custom UI components

Pilot floating window

7. AR Projection

This module demonstrates how to project points, lines, polygons, and circles into Pilot's AR view, used to annotate target positions, operation boundaries, and warning ranges on the real image. The position of every element is computed from the aircraft's real-time position, so the aircraft must be connected.

CaseEffect you'll see
PointProject 3 AR points each at 40m and 80m in front of the aircraft, 6 in total; after updating, demonstrates hiding text and icons by distance respectively, then restoring full visibility
LineProject a polyline containing 6 points; after updating, it becomes a green dashed line
PolygonProject an equilateral triangle and 3 vertices; after updating, it stretches into an 80m-tall triangular prism
CircleProject a green circle with a 20m radius; after updating, it stretches into an 80m-tall green cylinder
RadarShow or hide the AR radar's scan range on the screen

The left menu groups these five cases into "Custom Projection" (point, line, polygon, circle) and "System Projection" (radar).

7.1 Experience Flow

  1. Select an AR element from the left menu and tap "View Effect" to switch to Pilot.
  2. The floating window provides four buttons—query, upload, update, delete—for point, line, polygon, and circle, and two buttons—show, hide—for radar.
  3. Tap in the order "upload → update → delete", observe the elements appear, change, and disappear in the AR view; the result of each step is echoed in the floating window.

Sample case - AR projection

Sample case

Floating window case - AR projection

Pilot floating window

Note: An element must be uploaded before it can be updated or deleted. Uploading the same type of element again prompts you to delete the existing one first; if it prompts "Failed to get aircraft position", confirm the aircraft is connected.


8. Dialog

This module demonstrates how to make Pilot pop up standard-style dialogs. Dialogs are drawn and presented uniformly by Pilot; the plugin only provides the title, content, and options, and the user's operation result is passed back to the plugin via a callback.

CaseEffect you'll see
Tip dialogPop up a tip dialog with a single confirm button, for one-way notification
Confirm dialogPop up a confirm dialog with "Yes/No" buttons, returning the user's choice
Input dialogPop up a dialog with text input, returning the content the user entered
Single-choice dialogPop up an option list where the user can select only one item
Multi-choice dialogPop up an option list where the user can select multiple items at once

8.1 Experience Flow

  1. Select a dialog type from the left menu and tap "View Effect" to switch to Pilot.
  2. Tap the corresponding button in the floating window, and Pilot immediately pops up that type of dialog.
  3. After the operation, the "Callback Result" area of the floating window shows which button you tapped, what you entered, and which items you selected.

Sample case - Dialog

Sample case

Floating window case - Dialog

Pilot floating window

Only one dialog can exist at a time. Popping up another while the previous dialog is not closed prompts "Dialog already exists".


9. Camera View Drawing

This module demonstrates how to overlay graphics and text on Pilot's video feed, commonly used to visually present algorithm results such as target detection and obstacle recognition to the pilot.

CaseEffect you'll see
Rectangle boxOverlay detection rectangle boxes on the video feed, used to frame recognized targets
PolygonOverlay a solid polygon area on the video feed with a distance label, used to mark obstacles or operation areas
TextOverlay custom text at a designated position on the video feed, used to show real-time status

9.1 Experience Flow

  1. Select a drawing element from the left menu and tap "View Effect" to switch to Pilot.
  2. The floating window provides "Update" and "Clear" buttons: tap "Update" to draw the corresponding graphic on the video feed, and tap "Clear" to remove all content.
  3. Use the left/right arrows at the top of the floating window to switch to other drawing elements.

Sample case - Camera view drawing

Sample case

Floating window case - Camera view drawing

Pilot floating window

Note: Drawing of each element is a whole-list replacement. "Update" submits all the content to display currently; old graphics not in the submitted list disappear along with it. "Clear" is equivalent to submitting an empty list.


10. Page Navigation

This module demonstrates how to control Pilot's page switching from the plugin, connecting the operation flows of the plugin and Pilot. The module covers all 8 navigation targets.

CaseNavigation result
Pilot homeSwitch to Pilot's home page
Pilot map pageSwitch to Pilot's map page
Pilot wayline pageSwitch to Pilot's wayline display page
Pilot album pageSwitch to Pilot's album page
Pilot current pageSwitch to Pilot, staying on the page it's currently on
"Plugin App"Navigate from Pilot back to the plugin's home page
Custom plugin pageNavigate from Pilot back to the page the plugin is currently on
Custom remote pageNavigate to a custom remote page of the plugin

10.1 Experience Flow

  1. Select a navigation target from the left menu and tap "View Effect" to switch to Pilot.
  2. Tap the corresponding button in the floating window, and Pilot immediately navigates to the target page.
  3. Use the "Back to Plugin App" button in the floating window to return to the plugin and try other targets.

Sample case - Page navigation

Sample case

Floating window case - Page navigation

Pilot floating window

11. Wayline Mission

This module demonstrates how to import a local KMZ wayline file into Pilot. After importing, you can see the wayline on Pilot's wayline page.

CaseEffect you'll see
Import KMZ waylineSelect a KMZ file from local storage and push it to Pilot; the page shows the import progress and final result in real time

11.1 Experience Flow

  1. Enter the "Wayline Mission" module from the main screen.
  2. Tap "Select KMZ and import wayline", and select a KMZ file in the system file picker.
  3. The page shows the import progress percentage, and prompts success or failure when done.

Sample case - Wayline mission

Note: Wayline Mission is the only module that doesn't use the floating window; all operations are done within the plugin page, with no switch to Pilot.


12. FAQ

SymptomCause and handling
The module cards on the main screen don't respond to tapsThe connection or registration is not complete. Check whether the top badge shows both "Connected" and "Registered"
The floating window content isn't the case I just selectedThe floating window is globally unique and is redrawn by the new module when switching. Return to the plugin and tap "View Effect" again
The AR module prompts "Failed to get aircraft position"The position of AR elements is computed from the aircraft's real-time position. Confirm the aircraft is connected and retry
The AR module prompts to delete before uploadingThe same type of AR element can't be uploaded twice. Tap "Delete" to clear it first, then upload again
The dialog prompts "Dialog already exists"The previous dialog is not closed yet. Close it in Pilot before popping up a new one
The Wayline Mission prompts a missing permissionThe All Files Access permission was not granted. Follow the prompt to grant it in system settings and retry

13. Get the Sample Source Code

The DJI Pilot Plugin Sample and related scenario projects are organized under the dev-sdk-main branch of the Mobile SDK V5 repository. The source root is SampleCode-V5open in new window.

Project SourcePurpose
open-pilot-plugin-sampleopen in new windowDemonstrates custom UI components, AR projection, map widgets, dialogs, camera view drawing, page navigation, and wayline missions module by module, so developers can try the effects in Pilot and reference the interface implementations.
open-pilot-flighttask-sampleopen in new windowDemonstrates the complete workflow from Web-based task dispatch and work order reception on the remote controller to KMZ wayline execution and resource upload, with a DJI Pilot plugin and a Node.js demo backend as a reference for task management, wayline execution, and data synchronization.
open-pilot-gasdetection-sampleopen in new windowReceives gas measurements through the PSDK payload data channel and demonstrates inspection task dispatch, real-time monitoring and alerts, vessel recognition and following, and inspection record upload, with a reusable Android-side PSDK communication library.
open-pilot-patrol-sampleopen in new windowDemonstrates task dispatch, wayline inspection, target recognition and photo capture, map and AR markers, and resource upload, with a DJI Pilot plugin and a Node.js demo backend as a reference for intelligent inspection workflow orchestration.
Last Updated: