Package es.situm.sdk
Class SitumSdk
java.lang.Object
es.situm.sdk.SitumSdk
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" />
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic es.situm.sdk.calibration.CalibrationManagerReturns the CalibrationManager which can be used to calibrate Buildings.static CommunicationManagerReturns the communication manager.static ConfigurationReturns the public configuration holder.static DirectionsManagerReturns the route manager.static longReturn the device ID used internally in the SDKstatic StringReturns the version of the Situm SDKstatic voidinit(android.content.Context context) Initialize SDK.static booleanReturn true when the SDK has been initialized callinginit(Context)static booleanReturn true if a simulated location manager is set, false otherwisestatic LocationManagerReturns the location manager.static NavigationManagerReturns the navigation manager.static RealTimeManagerReturns realtime manager.static voidsetDebugOption(String key, boolean value) Set internal debug options.static voidsetDebugOption(String key, String value) Set internal debug options.static voidsetSimulatedLocationManager(LocationManager locationManager) Set a simulated location manager.static es.situm.sdk.userhelper.UserHelperManagerReturns theUserHelperManager.
-
Constructor Details
-
SitumSdk
public SitumSdk()
-
-
Method Details
-
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
Returns the version of the Situm SDK -
communicationManager
Returns the communication manager. Use it to make request to the server.- Throws:
IllegalStateException- ifinit(Context)wasn't invoked
-
locationManager
Returns the location manager. Use it to start and stop the location.- Throws:
IllegalStateException- ifinit(Context)wasn't invoked
-
configuration
Returns the public configuration holder. Use it to provide authentication credentials, and change some options as you need.- Throws:
IllegalStateException- ifinit(Context)wasn't invoked
-
directionsManager
Returns the route manager. Use it to obtain routes between two points- Throws:
IllegalStateException- ifinit(Context)wasn't invoked or no credentials were provided
-
realtimeManager
Returns realtime manager. It can be used to obtain data in realtime, checkRealTimeManagerfor more info.- Returns:
- RealtimeManager
- Throws:
IllegalStateException- ifinit(Context)wasn't invoked
-
calibrationManager
@NonNull public static es.situm.sdk.calibration.CalibrationManager calibrationManager()Returns the CalibrationManager which can be used to calibrate Buildings. CheckCalibrationManagerfor more info on its usage.- Returns:
- CalibrationManager
- Throws:
IllegalStateException- ifinit(Context)wasn't invoked
-
userHelperManager
@NonNull public static es.situm.sdk.userhelper.UserHelperManager userHelperManager()Returns theUserHelperManager. This manager assists users in configuring their device to be able to use our system properly. It provides UI components to guide users through various setup tasks, such as requesting permissions or enabling device sensors. For a detailed explanation of the supported use cases, refer toUserHelperManager.autoManage(boolean).- Returns:
UserHelperManagerThe instance of the UserHelperManager.- Throws:
IllegalStateException- Ifinit(Context)has not been called before invoking this method.
-
setDebugOption
Set internal debug options. -
setDebugOption
Set internal debug options. -
setSimulatedLocationManager
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:
IllegalStateException- ifinit(Context)wasn't invoked
-
isInitialized
public static boolean isInitialized()Return true when the SDK has been initialized callinginit(Context)
-