Skip to content

Integrating with Roadstr

Lwb89dev edited this page Oct 19, 2026 · 1 revision

Integrating with Roadstr

Sending a destination from another app

Roadstr accepts a destination sent explicitly to its launcher activity. The contract is the one already used by Tankful.

{"label":"Service station","lat":45.0703,"lon":7.6869}

The sender must use:

  • action android.intent.action.SEND;
  • MIME type application/json;
  • the JSON in the extra android.intent.extra.TEXT (Intent.EXTRA_TEXT);
  • an explicit intent — for instance from PackageManager.getLaunchIntentForPackage("app.roadstr").
val launch = packageManager.getLaunchIntentForPackage("app.roadstr") ?: return
launch.action = Intent.ACTION_SEND
launch.type = "application/json"
launch.putExtra(
    Intent.EXTRA_TEXT,
    """{"label":"Service station","lat":45.0703,"lon":7.6869}""",
)
startActivity(launch)

Roadstr handles a cold start and a new delivery to a running instance. If a GPS fix is already available it starts calculating the route at once; otherwise it opens the route planner with the destination filled in and leaves the origin and the Calculate route button to you.

Validation

The payload is treated as untrusted input and is rejected, leaving the current state unchanged, unless:

  • it is a closed JSON object with exactly label, lat and lon, no other fields and no duplicate keys;
  • label is non-empty, contains no control characters and is at most 300 characters long;
  • lat is a finite number in [-90, 90] and lon a finite number in [-180, 180];
  • the UTF-8 payload is at most 4096 bytes.

The authoritative text is docs/DESTINATION_JSON.md.

Reading and writing road reports from your own client

Road reports are ordinary Nostr events (kinds 1315–1318). Roadstr's layouts, the open jooray/roadstr layout, the compact binary frames used over radio, and golden test vectors that you can run against your own implementation are specified in the interoperability specification. The document is written so that someone who has never seen Roadstr can build a compatible client or bridge. See also Road reports and Interoperability and MeshCore.

Reusing the offline speech engine

The speech engine behind Voice search is a separate project, usable by other Android apps: roadstrapp/offline-speech-to-text (engine/), MIT-licensed, with a small Kotlin API (OfflineSttEngine) and a reproducible build. How Roadstr vendors it: third_party/offline-stt-engine.

Clone this wiki locally