Package es.situm.sdk

Class SitumSdk


  • public class SitumSdk
    extends java.lang.Object
    Main entry point for the Situm SDK. With this class you can get the managers to fetch resources from server, start the positioning, calculate a route and navigate through it.

    You must call init(Context) inside Application.onCreate() in your Application to initialize the SDK.

    After initialized, you can provide the authentication credentials and configure the Situm SDK with configuration(). Also, you can set the credentials in the AndroidManifest.xml file, it will be loaded automatically. To do this, use this meta-data fields:

     
    
     <meta-data
     android:name="es.situm.sdk.API_USER"
     android:value="API_USER_EMAIL" />
     <meta-data
     android:name="es.situm.sdk.API_KEY"
     android:value="API_KEY" />
     
     
    See Also:
    Configuration, CommunicationManager, LocationManager, DirectionsManager, NavigationManager
    • Constructor Detail

      • SitumSdk

        public SitumSdk()
    • Method Detail

      • init

        public static void init​(android.content.Context context)
        Initialize SDK. You have to call this function prior any call to other method. This method can be safely called many times as it will only initialise the SDK if it is not already initialised.
        Parameters:
        context - Your application context.
      • getVersion

        public static java.lang.String getVersion()
        Returns the version of the Situm SDK
      • communicationManager

        @NonNull
        public static CommunicationManager communicationManager()
        Returns the communication manager. Use it to make request to the server.
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • locationManager

        @NonNull
        public static LocationManager locationManager()
        Returns the location manager. Use it to start and stop the location.
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • configuration

        @NonNull
        public static Configuration configuration()
        Returns the public configuration holder. Use it to provide authentication credentials, and change some options as you need.
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • directionsManager

        @NonNull
        public static DirectionsManager directionsManager()
        Returns the route manager. Use it to obtain routes between two points
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • navigationManager

        @NonNull
        public static NavigationManager navigationManager()
        Returns the navigation manager. Use it to guide a user through a route in real time.
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • realtimeManager

        @NonNull
        public static RealTimeManager realtimeManager()
        Returns realtime manager. It can be used to obtain data in realtime, RealTimeManagercheck for more info.
        Returns:
        RealtimeManager
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • calibrationManager

        @NonNull
        public static es.situm.sdk.calibration.CalibrationManager calibrationManager()
        Returns the CalibrationManager which can be used to calibrate Buildings. Check CalibrationManager for more info on its usage.
        Returns:
        CalibrationManager
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked or no credentials were provided
      • setDebugOption

        public static void setDebugOption​(java.lang.String key,
                                          java.lang.String value)
        Set internal debug options.
      • setDebugOption

        public static void setDebugOption​(java.lang.String key,
                                          boolean value)
        Set internal debug options.
      • setSimulatedLocationManager

        public static void setSimulatedLocationManager​(@Nullable
                                                       LocationManager locationManager)
        Set a simulated location manager. This Location Manager will replace the Location Manager. To remove the simulated location manager call this method passing null parameter
      • isUsingSimulatedLocationManager

        public static boolean isUsingSimulatedLocationManager()
        Return true if a simulated location manager is set, false otherwise
      • getDeviceID

        @NonNull
        public static long getDeviceID()
        Return the device ID used internally in the SDK
        Throws:
        java.lang.IllegalStateException - if init(Context) wasn't invoked
      • isInitialized

        public static boolean isInitialized()
        Return true when the SDK has been initialized calling init(Context)