Dialog API

Overview

Dialog API provides the functions, which deal with presenting some custom information to drivers such as FlashMessage or ShowMessage.
Next, it provides the functions ShowDialog and CloseDialogs for a control of the application menu, and the events, which notify on some user interface operations.

FlashMessage

FlashMessage creates short lasting message flashing on screen, which automatically disappears in few seconds.

Check details of FlashMessage in the reference manual.

Example

In this example navigation flashes the message Please slow down! in the top right corner for few seconds.

        try {
            ApiDialog.flashMessage("Please slow down !", 2000);
        }
        catch (GeneralException ex)
        {}

ShowMessage

ShowMessage opens up the message popup on full screen, which needs to be confirmed by a driver.

Check details of ShowMessage in the reference manual.

Example

In this example navigation opens up the message Delivery Address on full navigation screen and requests to react with Ok or Cancel. The result of the answer is returned so that your application can react appropriately. In this case it flashes the message Thank you if the positive answer was given.

        int answer = 0;
        try {
            answer = ApiDialog.showMessage("Delivery Address: XY", 2, true,  0);
        }
        catch (GeneralException ex)
        {}

        if (answer == 201)
        {
            // action
            try {
                ApiDialog.flashMessage("Thank you !", 2000);
            }
            catch (GeneralException ex)
            {}
        }

ShowDialog

ShowDialogs opens a particular menu dialog of the navigation application.
The list of possible menu pages available for opening is defined with the enumeration class ApiDialog.DialogId.
Check details of ShowDialog in the reference manual.

Example

This example opens the Address search menu dialog.

        try {
            ApiDialog.showDialog(ApiDialog.DialogId.DLG_NAVIGATE_TO, 0);
        }
        catch (GeneralException ex)
        {
            Log.d("Error", "open dialog error");
        }

CloseDialogs

CloseDialogs closes any type of navigation menu dialog open and brings navigation to map screen.
Check details of CloseDialog in the reference manual.

Example

This example close any type of menu dialog open.

        try {
            ApiDialog.closeDialogs(0);
        }
        catch (GeneralException ex)
        {
            Log.d("Error", "close dialog error");
        }

Events

API Events allow monitoring of some menu events with a possibility to react on it.
The following events are available.

Event Description
EVENT_MAIN_MENU occurs when driver enters navigation menu
EVENT_EXIT_MENU occurs when menu is abandoned and navigation lands into map view
EVENT_CHANGE_LANGUAGE occurs when language has been changed by driver through menu

Check for more on Api Events in the reference manual.