Navigation Warnings

The Sygic Android SDK supports navigation on pedestrian and car routes. Using this feature, your app can check the current device position against a calculated route and provide just-in-time navigational instructions, both as visual and voice instructions. Turn-by-Turn Navigation Mode, which takes the calculated route and matches the current position against the route is supported for walking and driving.

While navigating, application can register a listener for warning notifications and display all of these notifications. All the types of notifications are listed in NavigationManager class. The following table shows the name of the available listeners and the information provided them.

Listener Name Function
OnCurrentStreetListener Whether the current street has changed
OnDirectionListener Whether the direction has chnaged
OnSpeedLimitListener Whether the user has exceeded the speed limit
OnNaviSignListener Whether the signpost has updated
OnRadarListener Whether a speedcamera is ahead
OnRailwayListener Whether a railway crossing is ahead
OnHighwayExitListener Whether a highway exit is ahead
OnWaypointPassedListener Whether the vehicle passed by a waipoint
OnTransportModeListener Whether the transport mode has changed (from car to pedestrian for example)
OnRouteInfoListener Whether the on route info has changed
OnTrafficDataListener Whether the traffic data has updated

Registering listener for every type has following pattern:

// create listener
 mOnCurrentStreetListener = new NavigationManager.OnCurrentStreetListener() {
                @Override
                public void onCurrentStreetChanged(final StreetInfo info) {
                    // info about changed value
                    Log.d("TAG", "StreetName: " + info.getStreetName());
                    Log.d("TAG", "RoadNumber: " + info.getRoadNumber());
                    ...
                }
            };

// register listener
NavigationManager.getInstance().addOnCurrentStreetListener(mOnCurrentStreetListener);

Don't forget to unregister listener when you don't need it.

NavigationManager.getInstance().removeOnCurrentStreetListener(mOnCurrentStreetListener);

Map Matching During Navigation

Map Matching is automatically enabled in both navigation mode and tracking mode. In simulation mode, the map-matched position is simulated along the route with a user-defined speed.

Voice Instructions

Voice instructions are available in the Sygic SDK as voice packages. Voice packages are available in two forms: pre-packaged or downloadable through the voice catalog. You can set a voice package to be used for navigational instructions. However, if a package is not set, the Sygic SDK sets the navigation voice language to US English, which is pre-packaged with the Sygic SDK.

The Sygic SDK supports two types of voice packages: text-to-speech or pre-recorded. Pre-recorded voice skins provide basic maneuver instructions, such as "turn right in 100 meters", while text-to-speech voices also support spoken street names, such as "turn right in 100 meters onto Wall Street".

Following code shows, how to get the list of available voices and setting the voice:

List<VoiceEntry> voices = VoiceManager.getInstance().getInstalledVoices();

VoiceManager.getInstance().setVoice(voices.get(0));

This will get you the list all the voices we support (pre-recorded and TTS voices). If you want to use a standard voice, following code shows you how to do that:

VoiceDownload voiceDownload = new VoiceDownload();
voiceDownload.addVoiceInstallationListener(new VoiceInstallListener() {
    @Override
    public void onAvailableVoiceList(List<VoiceEntry> voiceList, int result) {
    }
    @Override
    public void onVoiceInstallProgress(String id, long bytesDownloaded, long totalBytes) {
    }
    @Override
    public void onVoiceInstallFinished(VoiceEntry entry, int result) {
    }
    @Override
    public void onVoiceUninstallFinished(VoiceEntry entry, int result) {
    }
}

voiceDownload.installVoice(entry); // entry is an object returned in onAvailableVoiceList

This is a list of the potential TTS languages that are supported. Actual audio playback depends on the supported languages in the user's installed version of Android.

  • English (US)
  • English (UK)
  • French (France)
  • French (Canada)
  • German
  • Spanish (Spain)
  • Spanish (Mexico)
  • Indonesian
  • Italian
  • Norwegian
  • Portugese (Portugal)
  • Portugese (Brazil)
  • Russian
  • Swedish
  • Finnish
  • Danish
  • Korean
  • Chinese (Taiwanese Mandarin)
  • Turkish
  • Czech
  • Polish

Traffic

Traffic information show traffic incidents on the map. Traffic visualization requires a network data connection to download real time traffic information. However, traffic information may continue to be displayed thereafter without a connection until the traffic events expire or the visibility is toggled.

Traffic information

Signposts

Signs represent textual and graphic information which are along the route. The information is always represented as text or pictogram. Signpost information may be used for route guidance and map display. A navigation system may prefer using the signpost text rather than the street/ramp name as the latter may not always match what is on the sign in reality and may confuse a user. The signpost feature supports the user navigating through complex situations and provides a conformation for a maneuver by presenting the same direction information as shown on the street signs in reality.

Based on the map attributes, the Sygic Android Mobile SDKs aggregate the following information into a Signpost object:

  • Route number
  • Exit number
  • Exit name
  • Pictogram
  • Place name
  • Background color
  • Text color

Following example shows, how to get these information from the data structure, which the Android SDK offers.

public class SignpostFragment extends Fragment implements NavigationManager.OnNaviSignListener {

    private NavigationManager mManager;

    @Override
    public void onCreate(@Nullable final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mManager = NavigationManager.getInstance();
        mManager.addOnNaviSignListener(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();

        mManager.removeOnNaviSignListener(this);
    }

    // ....

    @Override
    public void onNaviSignChanged(@NonNull final List<NaviSignInfo> list) {
        if (list.isEmpty()) {
            return;
        }

        final NaviSignInfo naviSignInfo = list.get(0);
        final int textColor = naviSignInfo.getTextColor();
        final int backgroundColor = naviSignInfo.getBackgroundColor();
        final int distanceToSignpost = naviSignInfo.getDistance();

        final List<String> titles = new ArrayList<>();
        final List<String> roadNumbers = new ArrayList<>();
        final List<String> exits = new ArrayList<>();
        final List<String> exitNumbers = new ArrayList<>();

        for (NaviSignInfo.SignElement signElement : naviSignInfo.getSignElements()) {
            switch (signElement.getElementType()) {
                case NaviSignInfo.SignElement.SignElementType.PlaceName:
                case NaviSignInfo.SignElement.SignElementType.StreetName:
                case NaviSignInfo.SignElement.SignElementType.OtherDestination:
                    titles.add(signElement.getText());
                    break;
                case NaviSignInfo.SignElement.SignElementType.RouteNumber:
                    roadNumbers.add(signElement.getText());
                    break;
                case NaviSignInfo.SignElement.SignElementType.ExitName:
                    exits.add(signElement.getText());
                    break;
                case NaviSignInfo.SignElement.SignElementType.ExitNumber:
                    exitNumbers.add(signElement.getText());
                    break;
            }
        }

        // do something with the collected data
    }
}

Directions

To provide more detailed information in signpost, you can display the direction which the user should follow. The Directions feature allows developers to define and display routes between a start and a destination point within their application. NavigationManager.OnDirectionListener can return following information:

  • Direction distance
  • Next direction distance
  • Maneuver type - see the all available ManeuverTypes
  • Road name
  • Next road name

Following example shows, how to get these information from the data structure, which the Android SDK offers.

public class DirectionFragment extends Fragment implements NavigationManager.OnDirectionListener {

    private NavigationManager mManager;

    @Override
    public void onCreate(@Nullable final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mManager = NavigationManager.getInstance();
        mManager.addOnDirectionListener(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();

        mManager.removeOnDirectionListener(this);
    }

    // ....

    @Override
    public void onDirectionChanged(@NonNull final DirectionInfo directionInfo) {
        final int distance = directionInfo.getDistance();
        final int nextDistance = directionInfo.getNextDistance();

        final RouteManeuver primaryManeuver = directionInfo.getPrimary();
        if (primaryManeuver != null) {
            final int type = primaryManeuver.getType();
            final String roadName = primaryManeuver.getRoadName();
            final String nextRoadName = primaryManeuver.getNextRoadName();
            Log.d("directions", "direction of type " + type + " on the road " + roadName + ". Next road is " + nextRoadName);
        }

    }
}

With these data now you just have to draw them into your view and create your own signposts. For example like this:

Signpost

Junction View

Junction view is one of our advanced safety features. When you are approaching a complex highway intersection, a full screen diagram of the intersection will appear on the screen showing you in detail which lane you should be in. It guides you into the correct lane to make driving easier, safer and less stressful.

TBD

Speed Limit

Speed limits indicate the legal speed for a vehicle. Depending on the country the values are given in mph or kph.
A speed limit has the following attributes:

speedLimit - Value of the speed limit. Range: 1 - 999. For roads that allow an unlimited speed, the speed limit value is 999. A value of 998 is applied to ramps if there is neither a posted speed limit nor a legal speed limit.
isInMunicipality - Represents, if you are headin through Municipality, returns NO if you are not.
country - Get the region, in which you want to see the speedlimit. You can choose if you are in America or rest of the world. See the SpeedLimitCountry enum in API reference.

Report Incident

Our Speed Camera database consists of more than 60 000 fixed speed cameras, red light cameras and average speed checks all over the world. On top of that, the community reports tens of thousands of additional mobile speed cameras and police checks every day. So, if you want to help to make our database bigger, use following example to report an incident. As parameter you can choose in which direction it happened on the road.

navigationManager.getInstance().reportIncident(position, type, direction);