Class Sdk


  • public final class Sdk
    extends java.lang.Object
    • Method Detail

      • getInstance

        public static Sdk getInstance()
      • initSdkAsync

        public void initSdkAsync​(android.content.Context context,
                                 Sdk.ConfigurationSettings configurationSettings)
        Starts the SDK.

        Use this method to initialize the SDK. The process of initialization is asynchronous. Use Sdk.StateChangeListener to know when initialization has been finished.

        - If SDK state is Sdk.State.UNINITIALIZED or Sdk.State.INITIALIZATION_FAILED, regular initialization is started. - If SDK is already in Sdk.State.INITIALIZED state, then method is no-op regardless of whether configurationSettings are the same as settings used for previous initialization. - If SDK state is Sdk.State.INITIALIZING and deinitialization is pending (i.e. deinitializeSdk() was called in Sdk.State.INITIALIZING state), then pending deinitialization is cancelled, and initialization with new configurationSettings will be started once currently running initialization completes (successfully or not). In this case, there won't be a notification about completion of currently running initialization. Instead, there will be only notification about completion of initialization triggered by latest call to initSdkAsync. - If SDK state is Sdk.State.INITIALIZING, no deinitialization is pending, and provided configurationSettings are the same as settings for already running initialization, then method is no-op. - If SDK state is Sdk.State.INITIALIZING, no deinitialization is pending, and provided configurationSettings are different from settings used for already running initialization, then initialization with provided settings will be scheduled to start once currently running initialization completes. In this case, there won't be a notification about completion of currently running initialization. Instead, there will be only notification about completion of initialization triggered by latest call to initSdkAsync.

        Do not call this method synchronously in Sdk.StateChangeListener callback.

        Parameters:
        context - The context.
        configurationSettings - Configuration settings.
      • resume

        public void resume()
        Resumes the SDK. Switches on map rendering and resumes processing. SDK state should be Sdk.State.INITIALIZED, otherwise method is no-op.
      • pause

        public void pause()
        Pauses the SDK. Switches off map rendering and pauses processing. SDK state should be Sdk.State.INITIALIZED, otherwise method is no-op.
      • isPaused

        public boolean isPaused()
      • resumeGraphics

        public void resumeGraphics()
        Switches on map rendering. SDK state should be Sdk.State.INITIALIZED, otherwise method is no-op.
      • pauseGraphics

        public void pauseGraphics()
        Switches off map rendering. SDK state should be Sdk.State.INITIALIZED, otherwise method is no-op.
      • getState

        public Sdk.State getState()
        Returns:
        The current state of the SDK.
      • addStateChangeListener

        public void addStateChangeListener​(Sdk.StateChangeListener listener)
        Adds the specified listener to the list of SDK state change listeners.
        Parameters:
        listener - The listener.
      • removeStateChangeListener

        public void removeStateChangeListener​(Sdk.StateChangeListener listener)
        Removes the specified listener from the list.
        Parameters:
        listener - The listener.
      • isNight

        public boolean isNight()
        Returns:
        true if it's night at the current GPS position, false if it's day. If SDK is not initialized, returns false.
      • addDayNightChangeListener

        public void addDayNightChangeListener​(Sdk.DayNightChangeListener listener)
        Adds the listener, that will be notified, when current time switches from day to night and vice versa.
        Parameters:
        listener - The listener.
      • removeDayNightChangeListener

        public void removeDayNightChangeListener​(Sdk.DayNightChangeListener listener)
        Removes the specified listener from the list.
        Parameters:
        listener - The listener.
      • getPoiCategories

        public PoiCategory[] getPoiCategories()
        Returns the list of available POI categories.

        The categories are downloaded in background, and the returned array can be empty, if the download hasn't been finished.

        Use addPoiCategoriesListener(PoiCategoriesListener) to know when the categories have been downloaded.

        Returns:
        The array of POI categories.
      • addPoiCategoriesListener

        public void addPoiCategoriesListener​(Sdk.PoiCategoriesListener listener)
        Adds the listener, that will be notified when the list of POI categories has been downloaded.
        Parameters:
        listener - The listener.
      • removePoiCategoriesListener

        public void removePoiCategoriesListener​(Sdk.PoiCategoriesListener listener)
        Removes the specified listener from the list.
        Parameters:
        listener - The listener.
      • getVersion

        public static java.lang.String getVersion()
        Returns:
        The version of the SDK.
      • getDeviceId

        public java.lang.String getDeviceId()
        Returns:
        A unique device identifier generated upon the first initialization of the SDK. Returns null is SDK is not in Sdk.State.INITIALIZED state.
      • setActiveMapView

        public void setActiveMapView​(MapView mapView)
        Sets the MapView which will be used to render the map. After MapView is no longer active, null must be passed to this method. Otherwise, memory leaks may occur. Must be called only if state is Sdk.State.INITIALIZED.
        Parameters:
        mapView - The map view.
      • getNavigationManager

        public NavigationManager getNavigationManager()
        Returns:
        The instance of the NavigationManager or null if the SDK hasn't been started.
      • getRoutingManager

        public RoutingManager getRoutingManager()
        Returns:
        The instance of the RoutingManager or null if the SDK hasn't been started.
      • getRouteVisualizer

        public RouteVisualizer getRouteVisualizer()
        Returns:
        The instance of the RouteVisualizer or null if the SDK hasn't been started.
      • getTrafficManager

        public TrafficManager getTrafficManager()
        Returns:
        The instance of the TrafficManager or null if the SDK hasn't been started.
      • getRouteNavigator

        public RouteNavigator getRouteNavigator()
        Returns:
        The instance of the RouteNavigator or null if the SDK hasn't been started.
      • getSearchManager

        public SearchManager getSearchManager()
        Returns:
        The instance of the SearchManager or null if the SDK hasn't been started.
      • getMapManager

        public MapManager getMapManager()
        Returns:
        The instance of the MapManager or null if the SDK hasn't been started.