One challenge we solved: a pipeline operator needed to inspect sections without cellular coverage. DJI SDK won't activate without internet, so a MAVLink solution with offline mode saved the client two weeks of downtime. DJI's typical video latency is 80–150 ms, but mishandling frames on the main thread can balloon it to 500 ms — critical for FPV. For debugging, we use SITL simulators to catch errors before field deployment. A typical DJI SDK project budget starts at $10,000, and simulation savings can reach $5,000 in testing.
Why DJI SDK App Registration Is a Hurdle
DJI Mobile SDK requires online AppKey registration on DJI servers at first launch. Without internet, the SDK won't initialize — the app cannot control the drone in connectivity blackspots until activation is done. For pipeline inspections or canyon flights, this is critical. DJI offers OfflineActivation via Enterprise license, but that requires a separate agreement. According to the DJI Developer Guide, this mode needs extra configuration. We help clients assess the need for offline mode and implement it if necessary.
Common ProductKey Lifecycle Mistake
Initialization sequence in DJI SDK 5.x:
-
SDKManager.getInstance().init()inApplication.onCreate() -
SDKManager.getInstance().registerApp()— asynchronous, callback inISDKManagerCallback - Only after
onRegisterSuccessdo we start listening toKeyedStoreorFlightController
The mistake: developers call FlightController.getState() before registration completes — get null, don't handle it, and the app crashes with NPE on the first flight. In SDK 4.x some methods worked on the DJI simulator but failed on real hardware. We intercept such states and guarantee stability.
How We Keep Video Latency Under 150 ms
Decoding H.264/H.265 via VideoFeeder gives 80–150 ms latency on SurfaceView — acceptable. But processing frames with an ML model on the main thread pushes it to 500+ ms. The correct pipeline:
- Decoded frames via MediaCodec with
BUFFER_FLAG_END_OF_STREAM. - ML inference on
Dispatchers.Default(separate thread). - Overlay result on the next frame. We apply this in every project — numbers verified from real flights.
MAVLink on ArduPilot/PX4: Architectural Choices
For custom platforms we use MAVLink — a binary protocol with specific message IDs for control: SET_POSITION_TARGET_LOCAL_NED, COMMAND_LONG with MAV_CMD_NAV_TAKEOFF and MAV_CMD_NAV_LAND. Connection: drone's Wi-Fi access point → UDP socket port 14550. On Android — DatagramSocket in CoroutineScope(Dispatchers.IO), heartbeat every 1000 ms. If no heartbeat for 3 seconds — trigger emergency UI state and block all commands.
Important: MAVLink packets go over UDP without delivery guarantees. For commands with acknowledgment (COMMAND_LONG), the drone replies with COMMAND_ACK. If ACK not received within 500 ms — retry up to 3 times, then failure state. All hand-implemented — the protocol has no built-in retry.
How to Choose Between DJI SDK and MAVLink
| Criterion | DJI SDK | MAVLink (ArduPilot/PX4) |
|---|---|---|
| Ease of start | High (ready components) | Low (protocol implementation needed) |
| Video latency | 80–150 ms | Depends on implementation |
| Offline mode | Requires Enterprise license | Works out of the box |
| Customization | Limited by SDK | Full freedom |
| Drone support | DJI, Autel, Parrot | Any running ArduPilot/PX4 |
Comparison: DJI SDK gives roughly half the video latency compared to a typical MAVLink implementation, but MAVLink gives full offline control.
UI: Joystick, Safety, Telemetry
Virtual joystick — MotionEvent on View, normalize to [-1, 1], send commands at 20 Hz (every 50 ms). Below 10 Hz the drone drifts; above 30 Hz channel load is unnecessary. Mandatory elements:
- Return-to-Home button with confirmation (double tap or hold 2 seconds)
- Battery level indicator (red at <20%)
- RSSI signal strength
- Takeoff lock when GPS < 6 satellites (for GPS Hold mode)
Detail: joystick implementation requires coordinate normalization and anti-jitter filtering to avoid cursor wobble.
Work Process & Timeline
| Stage | Duration |
|---|---|
| Platform & requirements analysis | 5–10 days |
| Architecture design | 3–5 days |
| Core development (control, video) | 2–4 weeks |
| UI & route planning | 2–4 weeks |
| Testing (SITL + field) | 1–2 weeks |
| Store deployment | 5–7 days |
Basic DJI SDK app — 4–8 weeks. Custom MAVLink with extended UI and autonomous missions — 3–6 months. We provide a free estimate after reviewing your use case.
What's Included in Turnkey Development
- Source code with comments
- Build & configuration documentation
- Configured keys and provisioning profiles
- App Store Connect / Google Play Console integration
- Operator training for the app
- 3 months of technical support post-release
Our team has extensive mobile drone development experience, delivering 30+ projects for inspection, agriculture, and reconnaissance. If you need a reliable drone control application, contact us for a free estimate and consultation on your project.







