HERE Android SDK Developer's Guide

TrafficWarner

The class TrafficWarner is a member of com.here.android.mpa.guidance .

Class Summary

public final class TrafficWarner

extends java.lang.Object

Represents the traffic warning information for the current navigation session.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in TrafficWarner
Nested Classes

public static abstract class TrafficWarner.Listener

A listener for traffic notifications which should be added to a traffic warner

Method Summary

Table 2. Methods in TrafficWarner
Methods

public void addListener (java.lang.ref.WeakReference <Listener> listener)

Adds a listener for the traffic warner

public void clear ()

Clears the traffic warner

public static TrafficNotification getNotificationOnRoute ()

Gets the traffic notification for the route currently in use by NavigationManager.

public static TrafficNotification getNotificationOnRoute (Route route)

Gets the traffic notification for a given Route.

public boolean init ()

Initializes the traffic warner, and starts it automatically.

public boolean isAhead (TrafficNotification notification)

Determines whether or not a traffic notification TrafficNotification is ahead of the last callback position

public boolean isOnRoute (Route route, TrafficNotification notification)

Determines whether or not a traffic notification TrafficNotification is on a given route Route

public boolean isValid ()

Determines whether or not the traffic warner is valid

public void removeListener (Listener listener)

Removes a listener from the traffic warner

public void start ()

Starts the traffic warner

public void stop ()

Stops the traffic warner

Class Details

Represents the traffic warning information for the current navigation session.

Method Details

public void addListener (java.lang.ref.WeakReference <Listener> listener)

Adds a listener for the traffic warner

Parameters:

  • listener

    to be added

public void clear ()

Clears the traffic warner

public static TrafficNotification getNotificationOnRoute ()

Gets the traffic notification for the route currently in use by NavigationManager.

Returns:

The notification for the route currently in use by NavigationManager or null if navigation is not active.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public static TrafficNotification getNotificationOnRoute (Route route)

Gets the traffic notification for a given Route.

Parameters:

  • route

    The route to query for a traffic notification.

Returns:

The traffic notification object.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public boolean init ()

Initializes the traffic warner, and starts it automatically. This method should be called only after NavigationManager is running with tracking, simulation, or navigation, or false will be returned.

Returns:

true if the initialization succeeded without errors.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public boolean isAhead (TrafficNotification notification)

Determines whether or not a traffic notification TrafficNotification is ahead of the last callback position

Parameters:

  • notification

    TrafficNotification to be checked

Returns:

true if the notification is ahead of last callback position

public boolean isOnRoute (Route route, TrafficNotification notification)

Determines whether or not a traffic notification TrafficNotification is on a given route Route

Parameters:

  • route

    Route to be used

  • notification

    Notification to be checked

Returns:

true if the notification is on the route

public boolean isValid ()

Determines whether or not the traffic warner is valid

Returns:

true if traffic warner is valid

public void removeListener (Listener listener)

Removes a listener from the traffic warner

Parameters:

  • listener

    to be removed

public void start ()

Starts the traffic warner

public void stop ()

Stops the traffic warner

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.