Vehicle Telematics in Mobile IoT App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Vehicle Telematics in Mobile IoT App
Complex
~1-2 weeks
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Vehicle Telematics in Mobile IoT Applications

Vehicle telematics collects data from moving objects: GPS coordinates, speed, mileage, driver behavior (hard acceleration, braking), fuel consumption, refrigerated body temperature. Data flows from onboard tracker via GPRS/LTE to server; mobile app is a dispatcher or fleet manager tool. Development breaks into three layers: tracker protocol, server platform, mobile client.

GPS Tracker Protocols

Trackers communicate via several common protocols:

Protocol Trackers Transport
Teltonika codec 8/8E Teltonika FMB920, FMC003 TCP
Concox Protocol Concox GT06, JT701 TCP
GT06N (Gotop) 90% cheap Chinese trackers TCP
NMEA 0183 Most GPS modules RS-232/TCP
MQTT JSON Modern IoT trackers MQTT/TLS

For parsing tracker protocols, use Traccar — open-source server platform supporting 200+ protocols. Traccar runs on your server, accepts tracker data and provides REST API + WebSocket for mobile clients. This is the most sensible starting path.

Traccar API: Android Integration

// Retrofit interface to Traccar API
interface TraccarApi {
    @GET("devices")
    suspend fun getDevices(
        @Query("all") all: Boolean = false,
        @Query("groupId") groupId: Long? = null,
    ): List<Device>

    @GET("positions")
    suspend fun getLatestPositions(
        @Query("deviceId") deviceId: Long? = null,
    ): List<Position>

    @GET("reports/trips")
    suspend fun getTrips(
        @Query("deviceId") deviceId: Long,
        @Query("from") from: String,  // ISO 8601
        @Query("to") to: String,
    ): List<Trip>
}

data class Position(
    val id: Long,
    val deviceId: Long,
    val latitude: Double,
    val longitude: Double,
    val speed: Double,     // knots, convert to km/h * 1.852
    val course: Double,
    val altitude: Double,
    val accuracy: Double,
    val fixTime: String,
    val valid: Boolean,
    val attributes: Map<String, Any>,  // battery, ignition, mileage, etc.
)

Real-time updates via Traccar WebSocket:

class TraccarWebSocketClient(private val baseUrl: String, private val token: String) {
    private val okHttpClient = OkHttpClient.Builder()
        .readTimeout(0, TimeUnit.MILLISECONDS)  // infinite timeout for WS
        .build()

    fun connect(): Flow<TraccarEvent> = callbackFlow {
        val request = Request.Builder()
            .url("wss://${baseUrl}/api/socket")
            .header("Cookie", "JSESSIONID=$token")
            .build()

        val ws = okHttpClient.newWebSocket(request, object : WebSocketListener() {
            override fun onMessage(webSocket: WebSocket, text: String) {
                val event = json.decodeFromString<TraccarSocketMessage>(text)
                event.positions?.forEach { trySend(TraccarEvent.Position(it)) }
                event.devices?.forEach { trySend(TraccarEvent.DeviceUpdate(it)) }
                event.events?.forEach { trySend(TraccarEvent.Alert(it)) }
            }

            override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
                close(t)
            }
        })
        awaitClose { ws.close(1000, "Closed") }
    }
}

Map with Live Markers

Google Maps SDK on Android with custom vehicle markers:

class FleetMapFragment : Fragment() {
    private lateinit var map: GoogleMap
    private val vehicleMarkers = HashMap<Long, Marker>()

    private fun updateVehiclePosition(position: Position) {
        val latLng = LatLng(position.latitude, position.longitude)
        val marker = vehicleMarkers[position.deviceId]

        if (marker == null) {
            val newMarker = map.addMarker(
                MarkerOptions()
                    .position(latLng)
                    .icon(getBitmapDescriptor(R.drawable.ic_truck, position.course))
                    .title(getVehicleName(position.deviceId))
            )
            vehicleMarkers[position.deviceId] = newMarker!!
        } else {
            // Animate marker movement
            animateMarker(marker, latLng, position.course)
        }
    }

    private fun animateMarker(marker: Marker, to: LatLng, bearing: Float) {
        val animator = ValueAnimator.ofFloat(0f, 1f).apply {
            duration = 1000
            interpolator = LinearInterpolator()
        }
        val from = marker.position
        animator.addUpdateListener { anim ->
            val fraction = anim.animatedValue as Float
            marker.position = LatLng(
                from.latitude + (to.latitude - from.latitude) * fraction,
                from.longitude + (to.longitude - from.longitude) * fraction,
            )
            marker.rotation = bearing
        }
        animator.start()
    }
}

Marker animation between positions is a detail often missed. Without it, the icon jumps across the map.

Driver Behavior Analytics

Hard acceleration (> 0.3g), braking (> 0.4g), sharp turns — events from tracker accelerometer, arrive in position attributes. Driver scoring calculated on backend, sent to app as daily/weekly aggregate: percentage of time with speeding, count of harsh events, rating 0-100.

Geofences — zones on map; entry/exit generates event. Add geofence from mobile app: draw polygon on map, send coordinates to Traccar Geofences API.

Offline and Cache

Dispatcher watches the app constantly; if server is down 5 minutes, can't show empty map. Cache latest positions of all vehicles in Room. On startup show cache, update via WebSocket. Last update timestamp visible in header.

Developing dispatcher app with map, real-time positions via Traccar and trip reports: 5-8 weeks. Full telematics platform with driver analytics, geofences and CAN data integration: 3-4 months. Cost calculated individually after analyzing fleet size and platform requirements.