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

Class is used for downloading and working with Location. More...

Public Member Functions

abstract void addLocationListener (LocationListener listener)
 Method is used to add LocationListener element which will notify about newly downloaded and set location.
 
abstract void removeLocationListener (LocationListener listener)
 Method is used for removing previously added LocationListener class element.
 
abstract void setLocationId (int locationId)
 Method is used for setting current location, which will be downloaded from server or from storage, if it was downloaded before. Result will be handled by LocationListener.
 
abstract int getLocationId ()
 Method returns current location unique identifier.
 
abstract void setLocationUpdateInterval (int interval)
 Method is used to change interval in seconds check for new version from server Default: 300s.
 

Detailed Description

Class is used for downloading and working with Location.

Referenced from NavigineSdk.

Definition at line 16 of file LocationManager.java.

Member Function Documentation

◆ addLocationListener()

abstract void com.navigine.idl.java.LocationManager.addLocationListener ( LocationListener listener)
abstract

Method is used to add LocationListener element which will notify about newly downloaded and set location.

Note
Do not forget to remove listener if it is no longer needed!
Parameters
listenerСorresponding LocationListener class.

Java code snippet:

// Add location listener
locationManager.addLocationListener(locationListener);

Kotlin code snippet:

// Add location listener
manager.addLocationListener(listener)

◆ getLocationId()

abstract int com.navigine.idl.java.LocationManager.getLocationId ( )
abstract

Method returns current location unique identifier.

Returns
current location unique identifier

Java code snippet:

// Get current location ID
int currentLocationId = locationManager.getLocationId();
System.out.println("Current location ID: " + currentLocationId);

Kotlin code snippet:

// Get current location ID
val currentLocationId = manager.getLocationId()
println("Current location ID: $currentLocationId")

◆ removeLocationListener()

abstract void com.navigine.idl.java.LocationManager.removeLocationListener ( LocationListener listener)
abstract

Method is used for removing previously added LocationListener class element.

Parameters
listenerСorresponding LocationListener class to remove.

Java code snippet:

// Remove location listener
locationManager.removeLocationListener(locationListener);

Kotlin code snippet:

// Remove location listener
manager.removeLocationListener(listener)

◆ setLocationId()

abstract void com.navigine.idl.java.LocationManager.setLocationId ( int locationId)
abstract

Method is used for setting current location, which will be downloaded from server or from storage, if it was downloaded before. Result will be handled by LocationListener.

Parameters
locationIdlocation id from CMS

Java code snippet:

// Set location ID to load
locationManager.setLocationId(12345);

Kotlin code snippet:

// Set location ID to load
manager.setLocationId(12345)

◆ setLocationUpdateInterval()

abstract void com.navigine.idl.java.LocationManager.setLocationUpdateInterval ( int interval)
abstract

Method is used to change interval in seconds check for new version from server Default: 300s.

Parameters
intervalupdate interval in seconds

Java code snippet:

// Set location update interval (in seconds)
locationManager.setLocationUpdateInterval(600); // 10 minutes

Kotlin code snippet:

// Set location update interval (in seconds)
manager.setLocationUpdateInterval(600) // 10 minutes

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