Multiple integration options for different use cases. Build companion apps with Bluetooth, track locations with REST APIs, or integrate hardware devices via MQTT.
👓 New: Bluetooth Low Energy API
Now you can build HUD glasses, smartwatch apps, and custom displays that receive real-time navigation data from TripQube over Bluetooth. Jump to guide →
Build companion apps receiving real-time navigation data.
Register and authenticate devices via HTTP endpoints.
Push real-time location data via HTTP POST requests.
Connect hardware GPS devices and IoT applications.
Build companion apps that receive real-time navigation data from TripQube over Bluetooth Low Energy. Perfect for HUD glasses, smartwatch displays, custom dashboards, and IoT devices.
// Scan for TripQube Bluetooth service
val scanner = bluetoothAdapter?.bluetoothLeScanner ?: return
val filter = ScanFilter.Builder()
.setServiceUuid(ParcelUuid(SERVICE_UUID))
.build()
scanner.startScan(listOf(filter), scanSettings(), scanCallback)
// Listen for navigation data
gatt.setCharacteristicNotification(navCharacteristic, true)
override fun onCharacteristicChanged(
gatt: BluetoothGatt,
characteristic: BluetoothGattCharacteristic,
value: ByteArray
) {
val frame = decode(value) // Parse the binary frame
when (frame) {
is NavUpdate -> updateNavigation(frame)
is Position -> updatePosition(frame)
// Handle other frame types...
}
}
| Type | Frequency | Purpose | Example |
|---|---|---|---|
TYPE_NAV (1) |
~1 Hz | Maneuver & instruction | "Turn right on Main St, 250m" |
TYPE_POSITION (2) |
~1 Hz | Current location & speed | Lat/Lng, bearing, 45 km/h |
TYPE_ROUTE_BEGIN (3) |
On route change | Route started signal | Generation ID, point count |
TYPE_ROUTE_CHUNK (4) |
On route change | Route geometry (delta-encoded) | 50+ points per packet |
TYPE_STOPS (5) |
On waypoint change | Waypoints & destination | Multiple stops with status |
TYPE_TRAVELLED_* (8-9) |
Continuous | Path already ridden | For visual playback |
| Code | Maneuver | Code | Maneuver |
|---|---|---|---|
1 |
Straight | 13 |
Roundabout |
2 |
Turn Left | 14 |
Destination |
3 |
Turn Right | 15 |
Depart |
4 |
Slight Left | 20 |
Free Drive (no route) |
5 |
Slight Right | 6-7 |
Sharp Left/Right |
8-9 |
U-Turn | 10-12 |
Keep/Merge |
data class NavUpdate(
val maneuverCode: Int,
val distanceMetres: Int,
val arrivalMinutes: Int?,
val instruction: String,
val altitudeMetres: Int?
)
// Frame format (9+ bytes):
// Offset Size Field
// 0 1 Version (6)
// 1 1 Type (1 = NAV)
// 2 1 Maneuver code
// 3..4 2 Distance metres (uint16)
// 5..6 2 Arrival minutes (0xFFFF = unknown)
// 7..8 2 Altitude metres (0x7FFF = unknown)
// 9+ var Instruction text (UTF-8)
data class Position(
val latitude: Double,
val longitude: Double,
val bearingDegrees: Float?,
val speedKph: Int
)
// Frame format (14 bytes):
// Offset Size Field
// 0 1 Version (6)
// 1 1 Type (2 = POSITION)
// 2..5 4 Latitude (degrees × 10^7, int32)
// 6..9 4 Longitude
// 10..11 2 Bearing tenths of degree (0xFFFF = unknown)
// 12 1 Speed km/h (uint8)
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
gatt.requestMtu(517)SCAN_MODE_LOW_POWER to reduce battery drainFor complete protocol specifications, advanced examples, and reference implementations, see:
Integrate GPS tracking and location services using our HTTP REST API. Perfect for web applications, server-side integrations, and general-purpose development.
Register a new hardware device to the TripQube system. This is a public endpoint that does not require user authentication.
{
"device_id": "TRK-ABC-12345",
"pin": "98765",
"firmware_version": "2.1.0",
"manufacturer": "TripQube Hardware"
}
| Field | Type | Required | Description |
|---|---|---|---|
device_id |
string | ✅ Yes | Unique device identifier (max 100 chars) |
pin |
string | ✅ Yes | 5-digit authentication PIN |
firmware_version |
string | ✅ Yes | Device firmware version (max 50 chars) |
manufacturer |
string | ✅ Yes | Device manufacturer name (max 100 chars) |
{
"success": true,
"message": "Approved device registered successfully.",
"device_id": "TRK-ABC-12345"
}
Push location data from your hardware device to update tracker position. Supports both single location updates and buffered batch updates for offline scenarios.
{
"device_id": "TRK-ABC-12345",
"pin": "98765",
"latitude": 37.7749,
"longitude": -122.4194,
"battery_level": 85,
"timestamp": 1705012345000
}
{
"device_id": "TRK-ABC-12345",
"pin": "98765",
"location_buffer": [
{
"latitude": 37.7749,
"longitude": -122.4194,
"timestamp": 1705012345000,
"speed": 15.5,
"altitude": 50
},
{
"latitude": 37.7750,
"longitude": -122.4195,
"timestamp": 1705012375000,
"speed": 20.2,
"altitude": 55
}
],
"battery_level": 84
}
| Field | Type | Required | Description |
|---|---|---|---|
device_id |
string | ✅ Yes | Hardware device identifier |
pin |
string | ✅ Yes | 5-digit authentication PIN |
latitude |
number | ⚠️ Conditional* | Latitude (-90 to 90) for single update |
longitude |
number | ⚠️ Conditional* | Longitude (-180 to 180) for single update |
battery_level |
number | ❌ Optional | Battery percentage (0-100) |
timestamp |
number | ❌ Optional | Unix timestamp (ms or seconds) |
location_buffer |
array | ⚠️ Conditional* | Array of location objects for batch update |
* Either (latitude AND longitude) OR location_buffer must be provided.
Simple Python implementation for pushing location data via HTTP.
import requests
import time
DEVICE_ID = "TRK-ABC-12345"
PIN = "98765"
PUSH_URL = "https://pushtrackerlocation-3y3utatgia-uc.a.run.app"
def push_location(lat, lon, battery=None):
payload = {
"device_id": DEVICE_ID,
"pin": PIN,
"latitude": lat,
"longitude": lon,
"timestamp": int(time.time() * 1000)
}
if battery is not None:
payload["battery_level"] = battery
response = requests.post(PUSH_URL, json=payload)
return response.json()
# Usage
result = push_location(37.7749, -122.4194, battery=85)
print(result)
Example implementation for Node.js server applications.
const axios = require('axios');
const DEVICE_ID = 'TRK-ABC-12345';
const PIN = '98765';
const PUSH_URL = 'https://pushtrackerlocation-3y3utatgia-uc.a.run.app';
async function pushLocation(lat, lon, battery = null) {
const payload = {
device_id: DEVICE_ID,
pin: PIN,
latitude: lat,
longitude: lon,
timestamp: Date.now()
};
if (battery !== null) {
payload.battery_level = battery;
}
const response = await axios.post(PUSH_URL, payload);
return response.data;
}
// Usage
pushLocation(37.7749, -122.4194, 85)
.then(result => console.log(result));
Get in touch with our developer support team or explore additional resources.