Class TrafficBroadcast

java.lang.Object
com.here.NativeBase
com.here.sdk.trafficbroadcast.TrafficBroadcast
All Implemented Interfaces:
LocationListener

public final class TrafficBroadcast extends NativeBase implements LocationListener

A TrafficBroadcast is expecting the RDS-TMC format and it can be used when there is no internet connection, so that the OfflineRoutingEngine can utilize traffic data coming over a radio channel. The activate() method needs to be called to receive traffic data events.

Note: In order to adopt the TrafficDataProvider interface special hardware is required. Talk to your HERE representative for more details. Only by adopting the TrafficDataProvider interface you can integrate radio station signals providing traffic broadcasts. Traffic broadcasts are meant to be used independently from the already included traffic on routes, on the map and from the HERE backends (when using the TrafficEngine).

This class continuously reacts to new locations provided from a location source and acts as a LocationListener. The location must be updated regardless of calling activate().

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • Constructor Details

  • Method Details

    • activate

      public void activate()

      Activates the reception of traffic data over the radio channel. This method is supposed to be called when the system loses internet connection, so that traffic data can be switched from the online source to the radio channel. When activation is done, requestTMCService is called from TMCServiceInterface

    • deactivate

      public void deactivate()

      Deactivates the reception of traffic data over the radio channel. When deactivation is done, requestTMCService is called from TMCServiceInterface With special case of countryCode parameter = 0

    • onTMCServiceProviderInfoUpdated

      public void onTMCServiceProviderInfoUpdated(@NonNull TMCServiceProviderInfo tmcServiceProdiverInfo)

      Must be called on every TMC service prodiver info update.

      Parameters:
      tmcServiceProdiverInfo -

      Contains service prodiver info in RDS-TMC format.

    • onTMCDataUpdated

      public void onTMCDataUpdated(@NonNull TMCData tmcData)

      Must be called on every TMC data update.

      Parameters:
      tmcData -

      Contains the traffic events in RDS-TMC format.

    • getTrafficDataProvider

      @Nullable public TrafficDataProvider getTrafficDataProvider()
      Returns:

      The traffic data provider that provides the traffic information.

    • onLocationUpdated

      public void onLocationUpdated(@NonNull Location location)

      Called each time a new location is available. In a navigation context while using the Navigator or VisualNavigator, it's required to set the Location.time parameter for each Location object so that the HERE SDK can map-match the locations properly. If the Location.time parameter is missing, the location will be ignored. For navigation, it is also recommended to provide the bearing and speed parameters for each Location object. Invoked on the main thread.

      Specified by:
      onLocationUpdated in interface LocationListener
      Parameters:
      location -

      Current location.