Loading...
Searching...
No Matches
com.navigine.idl.java.NavigineSdk Class Referenceabstract

Provides access to all services in the SDK. More...

+ Inheritance diagram for com.navigine.idl.java.NavigineSdk:

Public Member Functions

abstract void setUserHash (String userHash)
 Method is used to set USER_HASH from the user's profile in CMS.
 
abstract void setServer (String server)
 Method is used to set server url.
 
abstract void reset ()
 Resets SDK to the initial connection state: default production server URL, empty user hash, and a new session propagated to managers (same effect on session-aware managers as changing server or user hash). Call from the UI thread.
 
abstract LocationManager getLocationManager ()
 LocationManager instance, which could be used for working with the Location.
 
abstract NavigationManager getNavigationManager (LocationManager locationManager)
 NavigationManager instance, which could be used for working with the com.navigine.idl.java.Position.
 
abstract ZoneManager getZoneManager (NavigationManager navigationManager)
 ZoneManager instance, which could be used for working with zones and detecting enter and leave events. Zone
 
abstract AsyncRouteManager getAsyncRouteManager (LocationManager locationManager, NavigationManager navigationManager)
 AsyncRouteManager instance, which could be used for working with routing sessions. RouteSession
 
abstract NotificationManager getNotificationManager (LocationManager locationManager)
 NotificationManager instance, which could be used for working with notifications when detecting beacons. Notification
 
abstract StorageManager getStorageManager ()
 
abstract UserLocationLayer getUserLocationLayer (LocationWindow locationWindow)
 
abstract RouteLayer getRouteLayer (LocationWindow locationWindow)
 
abstract GuidanceCamera getGuidanceCamera (LocationWindow locationWindow, RouteLayer routeLayer)
 
abstract RouteSimulator getRouteSimulator (LocationWindow locationWindow)
 
abstract RouteManager getRouteManager (LocationManager locationManager, NavigationManager navigationManager)
 RouteManager instance, which could be used for working making routes, setting target points. RoutePath
 
abstract MeasurementManager getMeasurementManager (LocationManager locationManager)
 MeasurementManager instance, which could be used for managing measurement generators and handling sensor and signal measurements.
 
abstract MqttSession getMqttSession (NavigationManager navigationManager)
 MqttSession instance, which could be used for working with MQTT sessions.
 
abstract LocationListManager getLocationListManager ()
 
abstract boolean isValid ()
 

Static Public Member Functions

static NavigineSdk getInstance ()
 Method initializes Navigation library and returns NavigineSdk instance.
 
static String getVersion ()
 Method returns NavigineSdk SDK Version.
 
static String getDeviceId ()
 Method returns persistent device id.
 
static String getUserAgent ()
 Method returns current User-Agent string.
 
static long getRelativeTime ()
 Method returns current timestamp.
 

Detailed Description

Provides access to all services in the SDK.

Class contains a list of static functions for initializing library and list of functions for getting access to the managers, each of which will provide different opportunities for working with SDK

Note
SDK holds objects by weak references. You need to have strong references to them somewhere in the client code.

Definition at line 20 of file NavigineSdk.java.

Member Function Documentation

◆ getAsyncRouteManager()

abstract AsyncRouteManager com.navigine.idl.java.NavigineSdk.getAsyncRouteManager ( LocationManager locationManager,
NavigationManager navigationManager )
abstract

AsyncRouteManager instance, which could be used for working with routing sessions. RouteSession

Parameters
locationManagerLocationManager instance
navigationManagerNavigationManager instance
Returns
AsyncRouteManager instance

Java code snippet:

// Get AsyncRouteManager for async route operations
if (locationManager != null && navigationManager != null) {
asyncRouteManager = sdk.getAsyncRouteManager(locationManager, navigationManager);
if (asyncRouteManager != null) {
System.out.println("AsyncRouteManager successfully initialized");
}
}

Kotlin code snippet:

// Get AsyncRouteManager for async route operations
locationManager?.let { locationManager ->
navigationManager?.let { navigationManager ->
asyncRouteManager = sdkInstance.getAsyncRouteManager(locationManager, navigationManager)
asyncRouteManager?.let {
println("AsyncRouteManager successfully initialized")
}
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getDeviceId()

static String com.navigine.idl.java.NavigineSdk.getDeviceId ( )
inlinestatic

Method returns persistent device id.

Returns
persistent device id

Java code snippet:

// Get device ID
System.out.println("Device ID: " + NavigineSdk.getDeviceId());

Kotlin code snippet:

// Get device ID
println("Device ID: ${NavigineSdk.getDeviceId()}")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

Definition at line 386 of file NavigineSdk.java.

◆ getGuidanceCamera()

abstract GuidanceCamera com.navigine.idl.java.NavigineSdk.getGuidanceCamera ( LocationWindow locationWindow,
RouteLayer routeLayer )
abstract

Create a guidance camera bound to a route layer on the same window. The controller follows route progress and publishes the next instruction. It does not draw the route.

Parameters
locationWindowMap window whose camera is driven.
routeLayerRoute layer created for that window.

Java code snippet:

if (locationWindow != null && routeLayer != null) {
guidanceCamera = sdk.getGuidanceCamera(locationWindow, routeLayer);
// [java_GuidanceCamera_setMode]
guidanceCamera.setMode(GuidanceCameraMode.FOLLOWING);
// [java_GuidanceCamera_setMode]
// [java_GuidanceCamera_set2DMode]
guidanceCamera.set2DMode(false);
// [java_GuidanceCamera_set2DMode]
// [java_GuidanceCamera_mode]
System.out.println("Guidance mode: " + guidanceCamera.mode());
// [java_GuidanceCamera_mode]
// [java_GuidanceCamera_instruction]
RouteInstruction next = guidanceCamera.instruction();
if (next != null) {
System.out.println("Next instruction: " + next.getTitle() + " " + next.getDistance() + " m");
}
// [java_GuidanceCamera_instruction]
// [java_GuidanceCamera_addListener]
guidanceCamera.addListener(new GuidanceListener() {
@Override
public void onCameraModeChanged(GuidanceCameraMode mode) {
System.out.println("Guidance camera mode: " + mode);
}
@Override
public void onInstructionChanged(RouteInstruction instruction) {
System.out.println("Next: " + (instruction == null ? "none" : instruction.getTitle()));
}
});
// [java_GuidanceCamera_addListener]
}

Kotlin code snippet:

if (locationWindow != null && routeLayer != null) {
guidanceCamera = sdkInstance.getGuidanceCamera(locationWindow!!, routeLayer!!)
// [kotlin_GuidanceCamera_setMode]
guidanceCamera?.setMode(GuidanceCameraMode.FOLLOWING)
// [kotlin_GuidanceCamera_setMode]
// [kotlin_GuidanceCamera_set2DMode]
guidanceCamera?.set2DMode(false)
// [kotlin_GuidanceCamera_set2DMode]
// [kotlin_GuidanceCamera_mode]
println("Guidance mode: ${guidanceCamera?.mode}")
// [kotlin_GuidanceCamera_mode]
// [kotlin_GuidanceCamera_instruction]
val next = guidanceCamera?.instruction
println("Next instruction: ${next?.title} ${next?.distance} m")
// [kotlin_GuidanceCamera_instruction]
// [kotlin_GuidanceCamera_addListener]
guidanceCamera?.addListener(object : GuidanceListener() {
override fun onCameraModeChanged(mode: GuidanceCameraMode) {
println("Guidance camera mode: $mode")
}
override fun onInstructionChanged(instruction: RouteInstruction?) {
println("Next: ${instruction?.title} ${instruction?.distance} m")
}
})
// [kotlin_GuidanceCamera_addListener]
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getInstance()

static NavigineSdk com.navigine.idl.java.NavigineSdk.getInstance ( )
inlinestatic

Method initializes Navigation library and returns NavigineSdk instance.

Returns
instance of SDK

Java code snippet:

// Get SDK instance
sdk = NavigineSdk.getInstance();

Kotlin code snippet:

// Get SDK instance
sdk = NavigineSdk.getInstance()

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

Definition at line 348 of file NavigineSdk.java.

◆ getLocationListManager()

abstract LocationListManager com.navigine.idl.java.NavigineSdk.getLocationListManager ( )
abstract

Returns a manager that allows to manage locations list

Returns
Location list manager instance LocationListManager

Java code snippet:

// Get LocationListManager for location list operations
locationListManager = sdk.getLocationListManager();
if (locationListManager != null) {
System.out.println("LocationListManager successfully initialized");
}

Kotlin code snippet:

// Get LocationListManager for location list operations
locationListManager = sdkInstance.locationListManager
locationListManager?.let {
println("LocationListManager successfully initialized")
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getLocationManager()

abstract LocationManager com.navigine.idl.java.NavigineSdk.getLocationManager ( )
abstract

LocationManager instance, which could be used for working with the Location.

Returns
LocationManager instance

Java code snippet:

// Get LocationManager for working with locations
locationManager = sdk.getLocationManager();
if (locationManager != null) {
System.out.println("LocationManager successfully initialized");
}

Kotlin code snippet:

// Get LocationManager for working with locations
locationManager = sdkInstance.locationManager
locationManager?.let {
println("LocationManager successfully initialized")
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getMeasurementManager()

abstract MeasurementManager com.navigine.idl.java.NavigineSdk.getMeasurementManager ( LocationManager locationManager)
abstract

MeasurementManager instance, which could be used for managing measurement generators and handling sensor and signal measurements.

Parameters
locationManagerLocationManager instance
Returns
MeasurementManager instance

Java code snippet:

// Get MeasurementManager for measurements
if (locationManager != null) {
measurementManager = sdk.getMeasurementManager(locationManager);
if (measurementManager != null) {
System.out.println("MeasurementManager successfully initialized");
}
}

Kotlin code snippet:

// Get MeasurementManager for measurements
locationManager?.let { locationManager ->
measurementManager = sdkInstance.getMeasurementManager(locationManager)
measurementManager?.let {
println("MeasurementManager successfully initialized")
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getMqttSession()

abstract MqttSession com.navigine.idl.java.NavigineSdk.getMqttSession ( NavigationManager navigationManager)
abstract

MqttSession instance, which could be used for working with MQTT sessions.

Parameters
navigationManagerNavigationManager instance
Returns
MqttSession instance

Java code snippet:

// Get MqttSession for publishing position data via MQTT
if (navigationManager != null) {
mqttSession = sdk.getMqttSession(navigationManager);
if (mqttSession != null) {
System.out.println("MqttSession successfully initialized");
}
}

Kotlin code snippet:

// Get MqttSession for publishing position data via MQTT
navigationManager?.let { navigationManager ->
mqttSession = sdkInstance.getMqttSession(navigationManager)
mqttSession?.let {
println("MqttSession successfully initialized")
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getNavigationManager()

abstract NavigationManager com.navigine.idl.java.NavigineSdk.getNavigationManager ( LocationManager locationManager)
abstract

NavigationManager instance, which could be used for working with the com.navigine.idl.java.Position.

Parameters
locationManagerLocationManager instance
Returns
NavigationManager instance

Java code snippet:

// Get NavigationManager for navigation
if (locationManager != null) {
navigationManager = sdk.getNavigationManager(locationManager);
if (navigationManager != null) {
System.out.println("NavigationManager successfully initialized");
}
}

Kotlin code snippet:

// Get NavigationManager for navigation
locationManager?.let { locationManager ->
navigationManager = sdkInstance.getNavigationManager(locationManager)
navigationManager?.let {
println("NavigationManager successfully initialized")
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getNotificationManager()

abstract NotificationManager com.navigine.idl.java.NavigineSdk.getNotificationManager ( LocationManager locationManager)
abstract

NotificationManager instance, which could be used for working with notifications when detecting beacons. Notification

Parameters
locationManagerLocationManager instance
Returns
NotificationManager instance

Java code snippet:

// Get NotificationManager for notifications
if (locationManager != null) {
notificationManager = sdk.getNotificationManager(locationManager);
if (notificationManager != null) {
System.out.println("NotificationManager successfully initialized");
}
}

Kotlin code snippet:

// Get NotificationManager for notifications
locationManager?.let { locationManager ->
notificationManager = sdkInstance.getNotificationManager(locationManager)
notificationManager?.let {
println("NotificationManager successfully initialized")
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getRelativeTime()

static long com.navigine.idl.java.NavigineSdk.getRelativeTime ( )
inlinestatic

Method returns current timestamp.

Returns
internal timestamp

Java code snippet:

// Get relative time
System.out.println("Relative Time: " + NavigineSdk.getRelativeTime());

Kotlin code snippet:

// Get relative time
println("Relative Time: ${NavigineSdk.getRelativeTime()}")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

Definition at line 424 of file NavigineSdk.java.

◆ getRouteLayer()

abstract RouteLayer com.navigine.idl.java.NavigineSdk.getRouteLayer ( LocationWindow locationWindow)
abstract

Create layer that builds and renders routes on the location window. Location / position are obtained from LocationManager and NavigationManager.

Parameters
locationWindowMap window used for drawing.

Java code snippet:

// Create RouteLayer for building and drawing routes on the map
if (locationWindow != null) {
routeLayer = sdk.getRouteLayer(locationWindow);
if (routeLayer != null) {
System.out.println("RouteLayer successfully initialized");
}
}

Kotlin code snippet:

// Create RouteLayer for building and drawing routes on the map
if (locationWindow != null) {
routeLayer = sdkInstance.getRouteLayer(locationWindow!!)
routeLayer?.let {
println("RouteLayer successfully initialized")
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getRouteManager()

abstract RouteManager com.navigine.idl.java.NavigineSdk.getRouteManager ( LocationManager locationManager,
NavigationManager navigationManager )
abstract

RouteManager instance, which could be used for working making routes, setting target points. RoutePath

Parameters
locationManagerLocationManager instance
navigationManagerNavigationManager instance
Returns
RouteManager instance

Java code snippet:

// Get RouteManager for building routes
if (locationManager != null && navigationManager != null) {
routeManager = sdk.getRouteManager(locationManager, navigationManager);
if (routeManager != null) {
System.out.println("RouteManager successfully initialized");
}
}

Kotlin code snippet:

// Get RouteManager for building routes
locationManager?.let { locationManager ->
navigationManager?.let { navigationManager ->
routeManager = sdkInstance.getRouteManager(locationManager, navigationManager)
routeManager?.let {
println("RouteManager successfully initialized")
}
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getRouteSimulator()

abstract RouteSimulator com.navigine.idl.java.NavigineSdk.getRouteSimulator ( LocationWindow locationWindow)
abstract

Walk a polyline at a constant pedestrian speed. Does not move the user location layer and does not replace MeasurementManager signal simulation.

Parameters
locationWindowMap window whose frame clock drives the walk.

Java code snippet:

if (locationWindow != null) {
RouteSimulator routeSimulator = sdk.getRouteSimulator(locationWindow);
// [java_RouteSimulator_setGeometry]
List<GlobalPoint> walkPoints = new ArrayList<>();
walkPoints.add(new GlobalPoint(55.751, 37.618));
walkPoints.add(new GlobalPoint(55.752, 37.618));
routeSimulator.setGeometry(Collections.singletonList(new LocationPolyline(walkPoints, null)));
// [java_RouteSimulator_setGeometry]
// [java_RouteSimulator_setSpeed]
routeSimulator.setSpeed(1.4f);
// [java_RouteSimulator_setSpeed]
// [java_RouteSimulator_start]
boolean started = routeSimulator.start();
System.out.println("Route walk started: " + started);
// [java_RouteSimulator_start]
// [java_RouteSimulator_sample]
RouteSimulatorSample sample = routeSimulator.sample();
if (sample != null) {
System.out.println("Walk advance: " + sample.getAdvance() + " m");
}
// [java_RouteSimulator_sample]
}

Kotlin code snippet:

if (locationWindow != null) {
val routeSimulator = sdkInstance.getRouteSimulator(locationWindow!!)
// [kotlin_RouteSimulator_setGeometry]
val walk = LocationPolyline(
listOf(GlobalPoint(55.751, 37.618), GlobalPoint(55.752, 37.618)),
null,
)
routeSimulator.setGeometry(listOf(walk))
// [kotlin_RouteSimulator_setGeometry]
// [kotlin_RouteSimulator_setSpeed]
routeSimulator.setSpeed(1.4f)
// [kotlin_RouteSimulator_setSpeed]
// [kotlin_RouteSimulator_start]
val started = routeSimulator.start()
println("Route walk started: $started")
// [kotlin_RouteSimulator_start]
// [kotlin_RouteSimulator_sample]
val sample = routeSimulator.sample
println("Walk advance: ${sample?.advance} m")
// [kotlin_RouteSimulator_sample]
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getStorageManager()

abstract StorageManager com.navigine.idl.java.NavigineSdk.getStorageManager ( )
abstract

Returns a manager that allows to manage user storages

Returns
Storage manager instance StorageManager

Java code snippet:

// Get StorageManager for working with storages
storageManager = sdk.getStorageManager();
if (storageManager != null) {
System.out.println("StorageManager successfully initialized");
}

Kotlin code snippet:

// Get StorageManager for working with storages
storageManager = sdkInstance.storageManager
storageManager?.let {
println("StorageManager successfully initialized")
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getUserAgent()

static String com.navigine.idl.java.NavigineSdk.getUserAgent ( )
inlinestatic

Method returns current User-Agent string.

Returns
User-Agent string

Java code snippet:

System.out.println("User-Agent: " + NavigineSdk.getUserAgent());

Kotlin code snippet:

println("User-Agent: ${NavigineSdk.getUserAgent()}")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

Definition at line 405 of file NavigineSdk.java.

◆ getUserLocationLayer()

abstract UserLocationLayer com.navigine.idl.java.NavigineSdk.getUserLocationLayer ( LocationWindow locationWindow)
abstract

Create layer with the user location icon.

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ getVersion()

static String com.navigine.idl.java.NavigineSdk.getVersion ( )
inlinestatic

Method returns NavigineSdk SDK Version.

Returns
version of SDK

Java code snippet:

// Get SDK version
System.out.println("Navigine SDK Version: " + NavigineSdk.getVersion());

Kotlin code snippet:

// Get SDK version
println("Navigine SDK Version: ${NavigineSdk.getVersion()}")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

Definition at line 367 of file NavigineSdk.java.

◆ getZoneManager()

abstract ZoneManager com.navigine.idl.java.NavigineSdk.getZoneManager ( NavigationManager navigationManager)
abstract

ZoneManager instance, which could be used for working with zones and detecting enter and leave events. Zone

Parameters
navigationManagerNavigationManager instance
Returns
ZoneManager instance

Java code snippet:

// Get ZoneManager for working with zones
if (navigationManager != null) {
zoneManager = sdk.getZoneManager(navigationManager);
if (zoneManager != null) {
System.out.println("ZoneManager successfully initialized");
}
}

Kotlin code snippet:

// Get ZoneManager for working with zones
navigationManager?.let { navigationManager ->
zoneManager = sdkInstance.getZoneManager(navigationManager)
zoneManager?.let {
println("ZoneManager successfully initialized")
}
}

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ isValid()

abstract boolean com.navigine.idl.java.NavigineSdk.isValid ( )
abstract

Tells if this NavigineSdk is valid or not. Any other method (except for this one) called on an invalid NavigineSdk will throw java.lang.RuntimeException.

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ reset()

abstract void com.navigine.idl.java.NavigineSdk.reset ( )
abstract

Resets SDK to the initial connection state: default production server URL, empty user hash, and a new session propagated to managers (same effect on session-aware managers as changing server or user hash). Call from the UI thread.

Java code snippet:

sdk.reset();
System.out.println("SDK reset to initial state");

Kotlin code snippet:

sdk!!.reset()
println("SDK reset to initial state")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ setServer()

abstract void com.navigine.idl.java.NavigineSdk.setServer ( String server)
abstract

Method is used to set server url.

Parameters
servercustom server url in format: http[s]://example.com

Java code snippet:

// Set server URL (optional)
sdk.setServer("https://custom.navigine.com");

Kotlin code snippet:

// Set server URL (optional)
sdk?.setServer("https://custom.navigine.com")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.

◆ setUserHash()

abstract void com.navigine.idl.java.NavigineSdk.setUserHash ( String userHash)
abstract

Method is used to set USER_HASH from the user's profile in CMS.

Parameters
userHashauth token in format XXXX-XXXX-XXXX-XXXX

Java code snippet:

// Set user hash (authorization token)
sdk.setUserHash("XXXX-XXXX-XXXX-XXXX");

Kotlin code snippet:

// Set user hash (authorization token)
sdk?.setUserHash("XXXX-XXXX-XXXX-XXXX")

Reimplemented in com.navigine.idl.java.internal.NavigineSdkBinding.


The documentation for this class was generated from the following file: