Android Migration Guide from SDK 3.x to SDK 4.0.0+
Use this guide when upgrading an existing Android integration from any 3.x version to 4.0.0.
Update dependency
Update the SDK dependency in your app module:
implementation "com.telematicssdk:tracking:4.0.0"Minimum supported Android SDK version is 23. Target SDK 36 is supported.
Migration Matrix
| Area | SDK 3.x | SDK 4.0.0 | Migration |
|---|---|---|---|
| SDK dependency | com.telematicssdk:tracking:3.x.x | com.telematicssdk:tracking:4.0.0 | Update the Gradle dependency. |
| Minimum Android SDK | 21 in older docs | 23 | Update minSdkVersion if the host app still uses a lower value. |
| Enable SDK | setEnableSdk(enable, withCheckingPermissions) | setEnableSdk(enable) | Remove the second parameter. Permissions are checked when enabling. |
| Disable SDK after upload | setDisableWithUpload() | setEnableSdk(false) | Use setEnableSdk(false). setDisableWithUpload() is deprecated. |
| Settings creation | Legacy Settings(...) constructors with HF and ELM params | Settings() with builder functions | Replace constructors with Settings().accuracy(...).stopTrackingTimeout(...).autoStartOn(...).adOn(...).passiveDetectionOn(...). |
| ELM327 | setElmDevicesEnabled(), isElmDevicesEnabled(), getElmManager() | Removed | Delete ELM integration code and Bluetooth OBD flows. |
| Advertising ID | setAdvertisingId(), clearAdvertisingId() | Removed | Delete calls. No replacement is required in 4.0.0. |
| HF recording toggle | setHfRecordingEnabled(), isHfRecordingOn() | Removed | Delete calls. HF behavior is no longer configured by these APIs. |
| Persistent tracking | startPersistentTracking() | startTrackAsPersistent() | Replace with startTrackAsPersistent(). The old method is deprecated. |
| Tracking mode | Not available | setTrackingMode(), getTrackingMode() | Use TrackingMode.Standard or TrackingMode.Persistent to control track recording mode. |
| Persistent interval | Not available | setMaxPersistentTrackingInterval(), getMaxPersistentTrackingInterval() | Configure persistent track max duration. Valid range is 5..600 minutes; default is 240 minutes (4 hours). |
| Tracking state | Custom app-side checks | getTrackingState() | Use the SDK state API for automatic/manual tracking status. |
| Device ID registration state | Custom app-side checks | getDeviceIdRegistrationState() | Use the SDK state API for cached device ID registration status. |
| SDK version | Custom build config or dependency version | getSdkVersion() | Use the SDK version getter if runtime version checks are needed. |
| Passive detection | Not part of old settings builder | passiveDetectionOn() and setPassiveDetectionEnabled() | Configure via Settings at initialization or through TrackingApi. |
| Track point model | TrackPoint.vehicleIndicators existed | vehicleIndicators removed | Remove any usage or serialization dependency on this field. |
| Server DTO names | Some internal/server models used *ServerModel / *Dto names | Response/request models use *Response / *Request names | Update imports if your app directly references SDK DTO classes. |
Settings migration
Replace old constructors with the builder-style API.
Old:
val settings = Settings(
Settings.stopTrackingTimeHigh,
Settings.accuracyHigh,
true,
true,
false,
false
)New:
val settings = Settings()
.accuracy(Settings.accuracyHigh)
.stopTrackingTimeout(Settings.stopTrackingTimeHigh)
.autoStartOn(true)
.adOn(false)
.passiveDetectionOn(false)Settings() default values:
accuracy = Settings.accuracyHigh(100meters)stopTrackingTimeout = Settings.stopTrackingTimeHigh(5minutes)autoStartOn = trueadOn = falsepassiveDetectionOn = false
Builder functions:
accuracy(value: Int)sets the parking radius / location accuracy threshold.stopTrackingTimeout(value: Int)sets the timeout in minutes used before stopping tracking after motion inactivity.autoStartOn(value: Boolean)enables or disables automatic track start.adOn(value: Boolean)enables or disables accident detection.passiveDetectionOn(value: Boolean)enables or disables passive detection.
Enable and disable SDK
Old:
trackingApi.setEnableSdk(true, true)New:
trackingApi.setEnableSdk(true)To disable the SDK:
trackingApi.setEnableSdk(false)setDisableWithUpload() is deprecated in 4.0.0. Use setEnableSdk(false).
Tracking modes
4.0.0 adds explicit tracking modes.
TrackingMode.Persistent
In this mode, all tracks started in both manual and automatic modes are recorded as persistent. Track recording continues until trackingApi.stopTracking() is called or the maximum persistent tracking interval is reached.
In this mode, you can manually start a persistent track using either:
trackingApi.startTracking()
trackingApi.startTrackAsPersistent()TrackingMode.Standard
In this mode, all tracks started in both manual and automatic modes are recorded as standard. Track recording continues until trackingApi.stopTracking() is called or the motion stop detector is triggered.
Set the tracking mode:
trackingApi.setTrackingMode(TrackingMode.Persistent)
trackingApi.setTrackingMode(TrackingMode.Standard)Read the tracking mode:
val mode = trackingApi.getTrackingMode()Configure the persistent tracking interval:
trackingApi.setMaxPersistentTrackingInterval(240)
val maxInterval = trackingApi.getMaxPersistentTrackingInterval()The allowed interval is from 5 to 600 minutes. The default interval is 240 minutes (4 hours).
Start a persistent track once:
trackingApi.startTrackAsPersistent()startTrackAsPersistent() starts recording a persistent track once in manual mode, regardless of the configured TrackingMode.
startPersistentTracking() is deprecated in 4.0.0. Use startTrackAsPersistent() instead.
New state APIs
Use these APIs instead of app-side inferred state checks.
val trackingState = trackingApi.getTrackingState()
val deviceIdRegistrationState = trackingApi.getDeviceIdRegistrationState()
val sdkVersion = trackingApi.getSdkVersion()Tracking state response:
data class TrackingState(
val automaticTrackingStatus: TrackingStatus,
val manualTrackingStatus: TrackingStatus
)Device ID registration response:
data class DeviceIdRegistrationState(
val status: DeviceIdRegistrationStatus,
val checkedAtMillis: Long?
)enum class DeviceIdRegistrationStatus {
UNKNOWN,
NOT_SET,
VALID,
INVALID
}Removed APIs
Remove these APIs from the host app integration:
setAdvertisingId(...)clearAdvertisingId()setElmDevicesEnabled(...)isElmDevicesEnabled()getElmManager()setHfRecordingEnabled(...)isHfRecordingOn()setEnableSdk(enable, withCheckingPermissions)
Remove ELM / Bluetooth OBD screens, flows, imports, and related business logic. Bluetooth permissions are no longer needed for SDK 4.0.0.
Migration Checklist
- Update the dependency to
com.telematicssdk:tracking:4.0.0. - Make sure the host app uses
minSdkVersion 23or higher. - Replace old
Settings(...)constructors withSettings()and builder functions. - Remove HF and ELM settings arguments.
- Replace
setEnableSdk(enable, withCheckingPermissions)withsetEnableSdk(enable). - Replace
setDisableWithUpload()withsetEnableSdk(false). - Remove Advertising ID API calls.
- Remove ELM327 / Bluetooth OBD API calls and UI.
- Replace
startPersistentTracking()withstartTrackAsPersistent(). - Add
setTrackingMode(...)if the app needs explicit standard or persistent mode behavior. - Add persistent interval configuration if the default
240minutes is not suitable. - Use
getTrackingState()for tracking status UI or diagnostics. - Use
getDeviceIdRegistrationState()for device ID registration UI or diagnostics. - Use
getSdkVersion()for runtime SDK version checks. - Remove usage of
TrackPoint.vehicleIndicators. - Update direct DTO imports from old
*ServerModel/*Dtonames to current*Response/*Requestnames if the app references them. - Run a clean build and fix removed-method compile errors.
- Re-test login, SDK enable/disable, automatic tracking, manual tracking, persistent tracking, logout, and trip upload flows.
Notes for apps migrating from v2
If your app is still using old com.raxeltelematics.v2.sdk imports, first migrate imports to:
import com.telematicssdk.tracking...Then apply the 3.x to 4.0.0 migration steps above.
Updated about 1 hour ago
