Known Direct Subclasses |
Base class for a vehicle reporter that supports reporting of location updates. An app is allowed only one vehicle reporter.
Public Method Summary
void |
disableLocationTracking()
Stops location tracking.
|
void |
enableLocationTracking()
Start uploading position reports to the Fleet Engine backend.
|
long |
getLocationReportingIntervalMillis()
Returns the current location reporting interval, in milliseconds.
|
TraveledRouteInfo |
getTraveledRoute()
Returns the traveled route information so far in the current route session..
|
boolean |
isLocationTrackingEnabled()
Returns whether location tracking is enabled.
|
void |
restoreTraveledRouteSession()
Resumes sending collected location data to an existing route session.
|
void |
setLocationReportingInterval(long interval, TimeUnit
intervalUnits)
Sets the minimum interval at which location reports will be delivered to the
Fleet Engine backend.
|
void |
setSupplementalLocation(Location
location)
Sets supplementary location information which FleetEngine will use when it
deems it more accurate or current than the road-snapped locations generated
internally by the Driver SDK.
|
Inherited Method Summary
Public Methods
public void disableLocationTracking ()
Stops location tracking. No attempt is made to stop a report that is already in progress, but no new position reports will be generated or transmitted.
Tracking can be resumed after stopping by calling
enableLocationTracking()
again.
Throws
IllegalStateException | if location tracking was already stopped |
---|
public void enableLocationTracking ()
Start uploading position reports to the Fleet Engine backend. Reports are made periodically, by default every 10 seconds. Reports may be made less frequently if transient issues, such as loss of network connectivity, prevent report delivery.
Position reports are made in a background thread, this call returns immediately.
Location tracking may be disabled by calling
disableLocationTracking()
.
Reporting interval can be changed with
setLocationReportingInterval(long, TimeUnit)
.
Throws
IllegalStateException | if location tracking was already enabled |
---|
public long getLocationReportingIntervalMillis ()
Returns the current location reporting interval, in milliseconds.
public TraveledRouteInfo getTraveledRoute ()
Returns the traveled route information so far in the current route session..
A route session is defined from the moment that startGuidance is called until the guided navigation is ended or the application is closed. From the moment a route session is finished the route will be available for the following 10 minutes until it's cleared.
Note: In order to have location collection working properly for traveled routes, you
must also have Fleet Engine location reporting active by calling
enableLocationTracking()
.
public boolean isLocationTrackingEnabled ()
Returns whether location tracking is enabled.
public void restoreTraveledRouteSession ()
Resumes sending collected location data to an existing route session. If a session does not exist, calling this method will have no effect when location collection starts, and the traveled route data will be stored in a new route session.
Note: This method must be called before calling startGuidance on Nav SDK.
public void setLocationReportingInterval (long interval, TimeUnit intervalUnits)
Sets the minimum interval at which location reports will be delivered to the Fleet Engine backend.
Reporting is reset whenever this method is called, unless the given interval is equivalent to the existing one, in which case this call is ignored. You should typically call this method much less often than the requested reporting frequencies.
Parameters
interval | time scalar for the desired reporting interval. |
---|---|
intervalUnits | units of measure for the interval parameter. |
public void setSupplementalLocation (Location location)
Sets supplementary location information which FleetEngine will use when it deems it more accurate or current than the road-snapped locations generated internally by the Driver SDK.
Location data can be from other sources like external hardware or
FusedLocationProviderClient
.