One of the challenges we encountered was that a pipeline operator wanted to inspect sections without cellular coverage. DJI SDK does not activate without internet, while a MAVLink solution with offline mode saved the customer two weeks of downtime.
Average DJI video latency is 80–150 ms, but with incorrect processing on the main thread it grows to 500 ms, which is critical for FPV. For debugging we use SITL simulators, which allows us to identify errors before going to the field.
A typical DJI SDK project budget is calculated after audit; savings from the simulator at the testing stage are also calculated after audit.
Why is app registration in DJI SDK a problem?
DJI Mobile SDK requires online AppKey registration on DJI servers on first launch. Without internet the SDK does not initialize — the app cannot control the drone in an area without connectivity until it has passed activation at least once.
For pipeline inspection or flights in canyons this is critical. DJI offers OfflineActivation through an Enterprise license, but this is a separate agreement. According to DJI Developer Guide, this mode requires additional configuration.
We help clients assess the need for such a mode and, if necessary, implement offline activation support.
Typical error with ProductKey lifecycle
Connection algorithm in DJI SDK 5.x:
SDKManager.getInstance().init()inApplication.onCreate()SDKManager.getInstance().registerApp()— asynchronous, callback inISDKManagerCallback- Only after
onRegisterSuccessdo we start listening toKeyedStoreorFlightController
Error: a developer calls FlightController.getState() before registration completes — gets null, does not handle it, and the app crashes with an NPE on the first flight. In SDK 4.x some methods worked on the DJI simulator but crashed on a real device. We intercept such states and guarantee stability.
How to reduce video latency to 150 ms?
H.264/H.265 decoding via VideoFeeder gives 80–150 ms latency on SurfaceView — this is normal. But if frames are processed with an ML model on the main thread, latency grows to 500+ ms. The correct scheme is these steps:
- Decoded frames via MediaCodec with
BUFFER_FLAG_END_OF_STREAM. - ML inference on
Dispatchers.Default(separate thread). - Output the result with the next frame. We apply this approach in every project — the numbers are verified on real flights.
MAVLink on ArduPilot/PX4: architectural solutions
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: Wi-Fi access point of the drone → UDP socket port 14550.
On Android — DatagramSocket in CoroutineScope(Dispatchers.IO), heartbeat every 1000 ms. If heartbeat is not received for 3 seconds — we trigger an emergency UI state and block all commands.
Important: MAVLink packets go over UDP without delivery guarantees. For commands with acknowledgment (COMMAND_LONG), the drone responds with COMMAND_ACK. If ACK does not arrive within 500 ms — retry up to 3 attempts, then failure state. Everything is implemented manually — the protocol has no automatic retry.
How to choose between DJI SDK and MAVLink?
| Criterion | DJI SDK | MAVLink (ArduPilot/PX4) |
|---|---|---|
| Ease of start | High (ready-made components) | Low (protocol implementation required) |
| Video latency | 80–150 ms | Depends on implementation |
| Offline mode | Requires Enterprise license | Works immediately |
| Customization | Limited by SDK capabilities | Full freedom |
| Drone support | DJI, Autel, Parrot | Any on ArduPilot/PX4 |
Comparison: DJI SDK provides 2x lower video latency compared to a typical MAVLink implementation, but MAVLink allows full control of the drone without internet.
UI for control: joystick, safety, telemetry
Virtual joystick — MotionEvent on View, normalization to [-1, 1], command sending at 20 Hz (once every 50 ms). Below 10 Hz — the drone drifts, above 30 Hz — unnecessary load on the channel. Required elements:
- Return-to-Home button with confirmation (two taps or hold 2 sec)
- Battery charge indicator (red at <20%)
- Channel RSSI signal
- Takeoff lock when GPS < 6 satellites (for GPS Hold mode)
More details: joystick implementation requires coordinate normalization and an anti-jitter filter to avoid cursor trembling.
Work process and timelines
| Stage | Duration |
|---|---|
| Platform and requirements analysis | 5–10 days |
| Architecture design | 3–5 days |
| Core development (control, video) | 2–4 weeks |
| UI and routes | 2–4 weeks |
| Testing (SITL + field) | 1–2 weeks |
| Store deployment | 5–7 days |
A basic app on DJI SDK — 4–8 weeks. Custom on MAVLink with advanced UI and autonomous missions — 3–6 months. We provide estimates after studying your task.
What is included in turnkey development
- Source code with comments
- Build and configuration documentation
- Configured keys and provisioning profiles
- Integration with App Store Connect / Google Play Console
- Operator training on working with the app
- Technical support for 3 months after release
We are a team with experience in mobile development for UAVs. During this time we have completed 30+ projects for inspection, agriculture, and reconnaissance. If you need a reliable drone control app — contact us for a project estimate. Get a consultation for your project.







