Skip to main content

Java SDK

Maven:

<dependency>
<groupId>com.noxdren</groupId>
<artifactId>noxdren</artifactId>
<version>0.2.0</version>
</dependency>

Gradle:

implementation 'com.noxdren:noxdren:0.2.0'

Requires JDK 17+.

Quickstart​

import com.noxdren.*;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;

NoxdrenClient client = NoxdrenClient.builder().apiKey("ndx_...").build();

// Range rings
NoxdrenObject r = client.rangeiq().analyze(
RangeIqRequest.builder()
.userLat(37.5).userLon(-122.3)
.selectedDroneKey("mavic3pro")
.windSpeed(6.0).windDirection(270) // km/h in the default metric unit mode
.build());
for (NoxdrenObject ring : r.obj("result").list("rings")) {
System.out.println(ring.str("label") + " @ " + ring.num("battery_threshold_pct") + "%");
}

// Multi-leg mission (a catalog key is enough; the API fills in that
// aircraft's full profile)
NoxdrenObject m = client.missions().analyzeGeometry(
MissionRequest.builder()
.home(37.5, -122.3)
.drone("mavic3pro")
.waypoint(Waypoint.builder().lat(37.50).lon(-122.30).altitudeM(80).build())
.waypoint(Waypoint.builder().lat(37.52).lon(-122.31).altitudeM(100).build())
.weather(6.0, 270, 0, 20, 50)
.build());
System.out.println(m.obj("result").str("mission_verdict"));

// Options, a calibrated profile, and a flight-plan file
Map<String, Object> profile = new HashMap<>(client.drones().get("air3").obj("drone").raw());
profile.put("cruise_speed_mps", 7.25); // your calibrated value
NoxdrenObject f = client.missions().analyze(
MissionFileRequest.builder()
.missionFile(Path.of("route.kmz")) // DJI WPML/KMZ, KML/KMZ, GPX, Litchi CSV
.home(37.5, -122.3)
.drone(profile)
.battery(95, 25, 40)
.options(MissionOptions.builder().payloadG(0).terrainPolicy("fail").build())
.build());

MissionOptions covers payloadG, altPenalty, fineTuneFactor, preflightHoverS, globalCruiseMps, smartRthEnabled, useLiveWeather, and terrainPolicy ("warn" default, or "fail" for a retryable 503 instead of substituted terrain). MissionRequest.builder() also takes .options(...) and .drone(Map). Options, profiles and file upload need SDK 0.2.0 or later.

Read responses with typed navigation: r.obj("result").list("rings").get(0).str("label"), or r.raw() for the underlying map.

Error handling​

try {
client.rangeiq().analyze(req);
} catch (AuthenticationException e) { // 401
...
} catch (ValidationException e) { // 400/422
System.out.println(e.code() + " " + e.getMessage());
} catch (RateLimitException e) { // 429
System.out.println("retry after " + e.retryAfter() + "s");
} catch (NoxdrenException e) { // catch-all
System.out.println(e.code() + " " + e.requestId());
}

Transient errors retry automatically (backoff honoring Retry-After); tune with .maxRetries(0).

Configuration​

NoxdrenClient.builder()
.apiKey("ndx_...")
.baseUrl("https://api.noxdren.com")
.timeoutSeconds(30)
.maxRetries(2)
.build();

Coverage​

MethodEndpoint
client.drones().list() / .get(key)GET /v1/drones, /v1/drones/{key}
client.rangeiq().analyze(...)POST /v1/rangeiq/analyze
client.missions().analyzeGeometry(...)POST /v1/missions/analyze-geometry
client.missions().analyze(...)POST /v1/missions/analyze (file upload)
client.health() / .version()GET /v1/health, /v1/version

See the API reference for every field.