HERE Android SDK Developer's Guide

FleetConnectivityService

The class FleetConnectivityService is a member of com.here.android.mpa.fce .

Class Summary

public final class FleetConnectivityService

extends java.lang.Object

Main component of Fleet Connectivity Extension responsible for communication.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in FleetConnectivityService
Nested Classes

public static abstract interface FleetConnectivityService.Listener

Represents a listener to handle FleetConnectivityService incoming messages.

Method Summary

Table 2. Methods in FleetConnectivityService
Methods

public boolean forcePoll ()

Forces poll of new events, if the service is running.

public String getAssetId ()

Sets the asset ID that identifies this device.

public String getDispatcherId ()

Dispatcher ID that identifies the user of this device.

public static FleetConnectivityService getInstance ()

Returns the @{code FleetConnectivityService} singleton instance.

public long getPollingInterval ()

Polling interval specified in seconds.

public String getRunningJobId ()

Retrieves the ID of currently running job.

public boolean sendEvent (FleetConnectivityEvent event)

Dispatches the provided event.

public void setAssetId (String assetId)

Asset ID that identifies this device.

public void setDispatcherId (String dispatcherId)

Sets the dispatcher ID that identifies the user of this device.

public void setListener (Listener listener)

Sets the Listener that listens for messages from the FleetConnectivityService.

public void setPollingInterval (long interval)

Sets the polling interval specified in seconds.

public boolean start ()

Starts the service if it is not already started.

public boolean stop ()

Stops the service if it is running.

Class Details

Main component of Fleet Connectivity Extension responsible for communication.

Method Details

public boolean forcePoll ()

Forces poll of new events, if the service is running.

Returns:

false if service is not running.

public String getAssetId ()

Sets the asset ID that identifies this device. Will be reported in every event dispatched to the server. Server provides new messages based on this ID. Service won't start if it is not specified.

Returns:

Specified assetId.

public String getDispatcherId ()

Dispatcher ID that identifies the user of this device. Service won't start if it is not specified.

Returns:

Specified dispatcherId.

public static FleetConnectivityService getInstance ()

Returns the @{code FleetConnectivityService} singleton instance.

Returns:

@{code FleetConnectivityService} instance.

public long getPollingInterval ()

Polling interval specified in seconds. Default value is 10 seconds.

Returns:

Specified polling interval.

public String getRunningJobId ()

Retrieves the ID of currently running job.

Returns:

ID of the currently running job. Null if no job is in progress.

public boolean sendEvent (FleetConnectivityEvent event)

Dispatches the provided event.

Parameters:

Returns:

false if service is not running or conditions for given event are not met.

public void setAssetId (String assetId)

Asset ID that identifies this device. Will be reported in every event dispatched to the server. Server provides new messages based on this ID. Service won't start if it is not specified.

Parameters:

  • assetId

    Specified assetId.

public void setDispatcherId (String dispatcherId)

Sets the dispatcher ID that identifies the user of this device. Service won't start if it is not specified.

Parameters:

  • dispatcherId

    Specified dispatcherId.

public void setListener (Listener listener)

Sets the Listener that listens for messages from the FleetConnectivityService.

Parameters:

public void setPollingInterval (long interval)

Sets the polling interval specified in seconds. Default value is 10 seconds. Can be set to values greater than 0, otherwise exception is thrown.

Parameters:

  • interval

    Specified polling interval.

Throws:

  • IllegalArgumentException

    if interval is equal or less than 0.

public boolean start ()

Starts the service if it is not already started. Fails if assetId or dispatcherId is not set.

Returns:

false if assetId or dispatcherId is not set or service is already started.

public boolean stop ()

Stops the service if it is running.

Returns:

false if service is not running.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.